OSDN Git Service

clean
[pettanr/pettanr.git] / lib / locmare / list_group / list / through_filter.rb
1 module Locmare
2   module ListGroupModule
3     class ThroughFilterList < FilterList
4       attr :through
5       
6       def init
7         super
8         @through = @list_manifest.through
9       end
10       
11       def include_hash
12         {@through => {@filter_item_name => {}} }
13       end
14       
15       def where_condition filter_item_id
16         w = self.base_where_condition
17         w += ' and ' unless w.blank?
18         [w + @filter_table_name + '.id' + ' = ?', filter_item_id] 
19       end
20       
21     end
22     
23   end
24 end