OSDN Git Service

fix orm
[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             l = @has_many_manifest.list
22             list_result = @has_many_manifest.list.open(self.profiler.operators, {:id => self.item.id, :page => 1, :page_size => 3})
23             items = list_result.items 
24             ::Manifest::View::Filer.new self.has_many_model.item_name, items, nil, self.profiler.operators
25           end
26           
27           def profiler
28             @association.profiler
29           end
30           
31         end
32       end
33     end
34   end
35 end