OSDN Git Service

change page status
[pettanr/pettanr.git] / lib / locmare / profiler / association / has_one.rb
1 module Locmare
2   module ProfilerModule
3     module AssociationModule
4       class HasOne
5         attr :association, :has_one_manifest
6         def initialize association, has_one_manifest
7           @association = association
8           @has_one_manifest = has_one_manifest
9         end
10         
11         def item
12           self.profiler.item
13         end
14         
15         def has_one_model
16           @has_one_manifest.model
17         end
18         
19         def filer
20           list = ::Locmare::ListGroup.list(
21             @has_one_manifest.controller_name, 
22             @has_one_manifest.action_name, 
23             self.profiler.operators, 
24             {:id => self.item.id}
25           )
26           ::Locmare::Filer.new(
27             self.has_one_model.item_name, list.items, 
28             nil, self.profiler.operators
29           )
30         end
31         
32         def profiler
33           @association.profiler
34         end
35         
36       end
37     end
38   end
39 end