+ def self.show cid, opt = {}
+ Comic.find(cid, :include => self.show_include_opt(opt))
+ end
+
+ def self.show_include_opt opt = {}
+ res = [:author]
+ res.push(opt[:include]) if opt[:include]
+ res
+ end
+
+ def self.show_json_include_opt
+ {:include => :author}
+ end
+
+ def self.play cid, opt = {}
+ Comic.find(cid, include: [
+ :author,
+ :panels => [
+ :panel_pictures => :resource_picture,
+ :balloons => :speaches
+ ]
+ ], order: 'panels.t, speaches.t')
+ end
+
+ def to_json_play
+ self.to_json( :include => {:author => {}, :panels => {:methods => :panel_element}})
+ end
+
+ def self.visible_count
+ Comic.count 'visible > 0'
+ end
+