def self.list_opt
{:include => {
:panel_pictures => {
- :resource_picture => {:artist => {}, :license => {}}
+ :picture => {:artist => {}, :license => {}}
},
:speech_balloons => {:balloons => {}, :speeches => {}},
:author => {}
def self.list_json_opt
{:include => {
:panel_pictures => {
- :resource_picture => {:artist => {}, :license => {}}
+ :picture => {:artist => {}, :license => {}}
},
:speech_balloons => {:balloons => {}, :speeches => {}},
:author => {}
}}
end
+ def self.mylist au, opt = {}, page = 1, panel_page_size = Author.default_panel_page_size
+ opt.merge!(self.list_opt) unless opt[:include]
+ opt.merge!({:conditions => ['panels.author_id = ?', au.id], :order => 'panels.updated_at desc', :limit => panel_page_size, :offset => (page -1) * page_size})
+ Panel.find(:all, opt)
+ end
+
def self.show rid, au, opt = {}
r = Panel.find(rid, :include => self.show_include_opt(opt))
raise ActiveRecord::Forbidden unless r.visible?(au)
def self.show_include_opt opt = {}
res = {
:panel_pictures => {
- :resource_picture => {:artist => {}, :license => {}}
+ :picture => {:artist => {}, :license => {}}
},
:speech_balloons => {:balloons => {}, :speeches => {}},
:author => {}
def self.show_json_include_opt
{:include => {
:panel_pictures => {
- :resource_picture => {:artist => {}, :license => {}}
+ :picture => {:artist => {}, :license => {}}
},
:speech_balloons => {:balloons => {}, :speeches => {}},
:author => {}