OSDN Git Service

t#:
[pettanr/pettanr.git] / lib / manifest / list_group / list / through_filter.rb
index 1a6162e..2a08ad0 100644 (file)
@@ -2,7 +2,7 @@ module Manifest
   module ListGroupModule
     module ListModule
       class ThroughFilterList < FilterList
-        attr :list, :list_name, :list_manifest
+        attr :through
         
         def set_default
           super
@@ -10,18 +10,7 @@ module Manifest
         
         def init
           super
-          @through = @model_list_manifest.through
-          @filter_table_name = ::Manifest.manifest.models[@filter_item_name].classify.table_name
-        end
-        
-        def include_hash
-          {@through => {@filter_item_name => {}} }
-        end
-        
-        def where_condition filter_item_id
-          w = self.base_where_condition
-          w += ' and ' unless w.blank?
-          [w + @filter_table_name + '.id' + ' = ?', filter_item_id] 
+          @through = @args['through']
         end
         
       end