6 def initialize item_name, column_name, item, operators, manifest
8 @column_name = column_name
10 @operators = operators
13 @model = @item_name.classify.constantize
14 @model_attributes = @manifest.model(@item_name).attributes
15 @column_conf = @model_attributes[@column_name]
19 @model.human_attribute_name(@column_name)
23 case @column_conf['type']
36 @item.attributes[@column_name]
48 if @column_conf['source']
49 case @column_conf['source']['type']
64 '(' + view.t_selected_item(@column_conf['source']['key'], self.value) + ')'
71 def initialize item_name, item, operators, conf, manifest
72 @item_name = item_name
74 @operators = operators
78 @lists = @manifest.profiler(@item_name).lists
79 @belongs_to_conf = @manifest.profiler(@item_name).belongs_to
80 @has_many_conf = @manifest.profiler(@item_name).has_many
81 @has_one_conf = @manifest.profiler(@item_name).has_one
85 str.classify.constantize
89 @manifest.filer_managers[@item_name].open @item_name, [@item], @operators, nil
93 @conf['columns'].each do |column_name|
94 column = Column.new @item_name, column_name, @item, @operators, @manifest
99 def parent_item parent_model, model_belongs_to_conf
101 id_column = model_belongs_to_conf['id_column']
103 r = parent_model.show(@item.attributes[id_column], @operators)
104 rescue ActiveRecord::RecordNotFound
110 @belongs_to_conf.each do |association_model_name|
111 model_belongs_to_conf = @manifest.model(@item_name).belongs_to[association_model_name]
112 parent_model = self.modelize association_model_name
113 parent = self.parent_item parent_model, model_belongs_to_conf
115 parent_filer = @manifest.filer_managers[@item_name].open @item_name, [@item], @operators, nil
122 @has_many_conf.each do |profiler_list_name|
123 model_name = @lists['model_name']
124 list_name = @lists['list_name']
125 list = @manifest.list_managers[model_name].open(list_name, 1, 3, @operators)
127 has_many_filer = @manifest.filer_managers[model_name].open model_name, items, @operators, nil
133 @has_one_conf.each do |profiler_list_name|
134 list = @manifest.list_managers[@item_name].open(profiler_list_name, 1, 1, @operators)
136 has_one_filer = @manifest.filer_managers[@item_name].open @item_name, items, @operators, nil
143 def initialize profiler_manifest
144 @profiler_manifest = profiler_manifest
145 @item_name = @profiler_manifest.item_name
146 @manifest = profiler_manifest.manifest
147 @profiler_conf = @profiler_manifest.conf
150 def open item, operators
151 Profiler.new @item_name, item, operators, @profiler_conf, @manifest