by_sheet: {\r
type: 'through_filter',\r
from: 'sheet',\r
- through: 'sheet_panels',\r
+ through: 'story_sheets',\r
filter_key: 'sheet_id',\r
},\r
by_author: {\r
public_list: {\r
type: 'public',\r
},\r
+ private_list: {\r
+ type: 'private',\r
+ },\r
scroll_panels: {\r
type: 'has_many',\r
association_name: 'scroll_panels',\r
public_list: {\r
type: 'public',\r
},\r
+ private_list: {\r
+ type: 'private',\r
+ },\r
by_panel: {\r
type: 'filter',\r
from: 'panel',\r
public_list: {\r
type: 'public',\r
},\r
+ private_list: {\r
+ type: 'private',\r
+ },\r
by_panel: {\r
type: 'filter',\r
from: 'panel',\r
public_list: {\r
type: 'public',\r
},\r
+ by_speech_balloon: {\r
+ type: 'filter',\r
+ from: 'speech_balloon',\r
+ includes: {speech_balloon: {panel: {}}},\r
+ filter_key: 'speech_balloon_id',\r
+ },\r
by_writing_format: {\r
type: 'filter',\r
from: 'writing_format',\r
public_list: {\r
type: 'public',\r
},\r
+ by_speech_balloon: {\r
+ type: 'filter',\r
+ from: 'speech_balloon',\r
+ includes: {speech_balloon: {panel: {}}},\r
+ filter_key: 'speech_balloon_id',\r
+ },\r
#by_system_picture: {\r
# type: 'filter',\r
# from: 'system_picture',\r
public_list: {\r
type: 'public',\r
},\r
+ private_list: {\r
+ type: 'private',\r
+ },\r
by_panel: {\r
type: 'filter',\r
from: 'panel',\r
public_list: {\r
type: 'public',\r
},\r
+ private_list: {\r
+ type: 'private',\r
+ },\r
by_panel: {\r
type: 'filter',\r
from: 'panel',\r
}, \r
'sheets.by_story': {\r
model_name: 'sheet',\r
- list_name: 'by_sheet',\r
+ list_name: 'by_story',\r
}, \r
}, \r
columns: [\r
list_name: 'by_speech_balloon',\r
}, \r
'speech.by_speech_balloon': {\r
- model_name: 'panel',\r
+ model_name: 'speech',\r
list_name: 'by_speech_balloon',\r
}, \r
}, \r
get :show
end
member do
+ get :by_speech_balloon
#get :by_system_picture
end
end
get :show
end
member do
+ get :by_speech_balloon
get :by_writing_format
end
end
end
def includes
- @with_model_name ? {@with_model_name.classify.constantize.table_name => {}} : {}
+ # @with_model_name ? {@with_model_name.classify.constantize.table_name => {}} : {}
w = @owner_model ? {@owner_model.item_name => {}} : {}
w.merge({@association_model.table_name => {} })
end
@list_list_conf = @manifest.list(@item_name).lists[list_name] || {}
@from = @list_list_conf['from']
@filter_key = @list_list_conf['filter_key']
+ @includes = @list_list_conf['includes']
@with_model_name = @list_list_conf['with']
end
end
def includes
+ return @includes if @includes
w = @owner_model ? {@owner_model.item_name => {}} : {}
w.merge({@from => {} })
end
raise "undefined has_many list for #{model_name}::#{list_name}\nconf:#{@controller_conf}\n" unless @manifest.list_managers[model_name]
list = @manifest.list_managers[model_name].open(list_name, 1, 3, @operators)
items = list.items @item
+#p [model_name, list_name, @item, list.class, list.includes, list.where(@item )]
has_many_filer = @manifest.filer_managers[model_name].open model_name, items, @operators, nil
yield has_many_filer
end
def each_has_one
@has_one_conf.each do |profiler_list_name|
- list = @manifest.list_managers[@item_name].open(profiler_list_name, 1, 1, @operators)
- items = list.items
- has_one_filer = @manifest.filer_managers[@item_name].open @item_name, items, @operators, nil
+ raise "undefined lists for #{profiler_list_name} in #{@lists}\n" unless @lists[profiler_list_name]
+ model_name = @lists[profiler_list_name]['model_name']
+ list_name = @lists[profiler_list_name]['list_name']
+ raise "undefined has_one list for #{model_name}::#{list_name}\nconf:#{@controller_conf}\n" unless @manifest.list_managers[model_name]
+ list = @manifest.list_managers[model_name].open(list_name, 1, 1, @operators)
+ items = list.items @item
+ has_one_filer = @manifest.filer_managers[model_name].open model_name, items, @operators, nil
yield has_one_filer
end
end
"by_sheet": {\r
"type": "through_filter",\r
"from": "sheet",\r
- "through": "sheet_panels",\r
+ "through": "story_sheets",\r
"filter_key": "sheet_id"\r
},\r
"by_author": {\r
"public_list": {\r
"type": "public"\r
},\r
+ "by_speech_balloon": {\r
+ "type": "filter",\r
+ "from": "speech_balloon",\r
+ "includes": {\r
+ "speech_balloon": {\r
+ "panel": {}\r
+ }\r
+ },\r
+ "filter_key": "speech_balloon_id"\r
+ },\r
"by_writing_format": {\r
"type": "filter",\r
"from": "writing_format",\r
"lists": {\r
"public_list": {\r
"type": "public"\r
+ },\r
+ "by_speech_balloon": {\r
+ "type": "filter",\r
+ "from": "speech_balloon",\r
+ "includes": {\r
+ "speech_balloon": {\r
+ "panel": {}\r
+ }\r
+ },\r
+ "filter_key": "speech_balloon_id"\r
}\r
}\r
},\r
},\r
"sheets.by_story": {\r
"model_name": "sheet",\r
- "list_name": "by_sheet"\r
+ "list_name": "by_story"\r
}\r
},\r
"columns": [\r
"list_name": "by_speech_balloon"\r
},\r
"speech.by_speech_balloon": {\r
- "model_name": "panel",\r
+ "model_name": "speech",\r
"list_name": "by_speech_balloon"\r
}\r
},\r