OSDN Git Service

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