@select_items = {\r
model_loader: {\r
writing_format_items: {\r
- model: 'writing_format',\r
+ model_name: 'writing_format',\r
list_name: 'select_items',\r
caption: 'caption'\r
},\r
license_group_items: {\r
- model: 'license_group',\r
+ model_name: 'license_group',\r
list_name: 'select_items',\r
caption: 'caption'\r
},\r
speech_balloon_template_items: {\r
- model: 'speech_balloon_template',\r
+ model_name: 'speech_balloon_template',\r
list_name: 'select_items',\r
caption: 'caption'\r
},\r
# call after load app
def select_items_loader
@system_resources.select_items['model_loader'].each {|name, conf|
- list = Pettanr::Application::manifest.list_managers[conf['model']].open conf['list_name'], nil, nil, nil
+ model_name = conf['model_name']
+ list_name = conf['list_name'] || 'select_items'
+ caption = conf['caption']
+ list = @lists[model_name][list_name]
@select_items['model'] ||= {}
@select_items['model'][name] = list.items.map {|item| [item.caption, item.id]}
}