OSDN Git Service

fix SystemResources manifest
authoryasushiito <yas@pen-chan.jp>
Tue, 28 Jan 2014 08:13:25 +0000 (17:13 +0900)
committeryasushiito <yas@pen-chan.jp>
Tue, 28 Jan 2014 08:13:25 +0000 (17:13 +0900)
app/assets/javascripts/manifest/work/system_resources.js.coffee.erb
lib/manifest/manifest.rb

index 1fe57fb..43664a8 100644 (file)
 @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
index e12d5c0..94e47a8 100644 (file)
@@ -30,7 +30,10 @@ module Manifest
     # 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]}
       }