OSDN Git Service

rename model name
[pettanr/pettanr.git] / lib / locmare / list_group.rb
index e208938..eae27aa 100644 (file)
@@ -18,10 +18,19 @@ module Locmare
       }
     end
     
-    def self.list item_name, list_name
-      list_group_manifest = LocalManifest.manifest.list_groups[item_name]
-      list_manifest = list_group_manifest.lists[list_name]
-      self.types[list_manifest.type].new item_name, list_name
+    def self.list controller_name, action_name, operators, options = {}
+      controller_manifest = Manifest.manifest.controllers[controller_name]
+      action_manifest = controller_manifest.actions[action_name]
+      if action_manifest.alias
+        options['order'] ||= action_manifest.order
+        options['direction'] ||= action_manifest.direction
+        alias_action = action_manifest.alias_action
+        ::Locmare::ListGroup.list alias_action.path_name, alias_action.name, operators, options
+      else
+        list_group_manifest = LocalManifest.manifest.list_groups[controller_name]
+        list_manifest = list_group_manifest.lists[action_name]
+        self.types[list_manifest.type].new controller_name, action_name, operators, options
+      end
     end
     
   end