-class ScrollPanel < Peta::Content
+class ScrollPanel < Peta::Leaf
load_manifest
belongs_to :author
belongs_to :panel
validates :author_id, :presence => true, :numericality => true, :existence => {:both => false}
validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
- def tag_attributes column = nil, opt = {}
- {
- }
- end
-
def supply_default
self.scroll_id = nil
self.panel_id = nil
self.author_id = operators.author.id
end
- def visible? operators
- return false unless super
- self.owner_model.visible? operators
- end
-
- def self.list_order
+ def self.public_list_order
'scroll_panels.updated_at desc'
end
'scrolls.visible > 0'
end
+ def self.by_author_list_includes
+ {
+ :scroll => {
+ :author => {}
+ }
+ }
+ end
+
def self.play_list_where cid
['scroll_panels.scroll_id = ?', cid]
end