OSDN Git Service

fix extend for profiler
[pettanr/pettanr.git] / lib / local_manifest / profiler.rb
1 ManifestBase.require_modules "local_manifest/profiler/", 
2   %w|list association|
3
4 module LocalManifest
5   class Profiler < ManifestBase::Base
6     include ProfilerModule
7     
8     attr :column_names, :lists, :associations
9     
10     def set_default
11       super
12       @json['column_names'] ||= []
13       @json['lists'] ||= {}
14       @json['associations'] ||= {}
15     end
16     
17     def init
18       super
19       @column_names = ['id'] + @json['column_names'] + ['created_at', 'updated_at']
20       @lists =  ManifestBase.load_type_name_args self, @json, 'lists', List
21       @associations = ManifestBase.load_value self, @json, 'associations', Association
22     end
23     
24     def item_name
25       @name
26     end
27     
28     def each_column
29       @column_names
30     end
31     
32   end
33   
34 end
35