OSDN Git Service

separate manifest
[pettanr/pettanr.git] / lib / locmare / profiler / association / has_many.rb
1 module Locmare
2   module ProfilerModule
3     module AssociationModule
4       class HasMany
5         attr :association, :has_many_manifest
6         def initialize association, has_many_manifest
7           @association = association
8           @has_many_manifest = has_many_manifest
9         end
10         
11         def item
12           self.profiler.item
13         end
14         
15         def has_many_model
16           @has_many_manifest.model
17         end
18         
19         def filer
20           list_result = @has_many_manifest.list.open(self.profiler.operators, {:id => self.item.id, :page => 1, :page_size => 3})
21           items = list_result.items 
22           ::Locmare::Filer.new self.has_many_model.item_name, items, nil, self.profiler.operators
23         end
24         
25         def profiler
26           @association.profiler
27         end
28         
29       end
30     end
31   end
32 end