1 class ScrollPanel < Peta::Leaf
7 validates :scroll_id, :presence => true, :numericality => true, :existence => {:both => false}
8 validates :panel_id, :presence => true, :numericality => true, :existence => {:both => false}
9 validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
17 def overwrite operators
18 return false unless operators.author
19 self.author_id = operators.author.id
22 def self.public_list_where
26 def self.by_author_list_includes
42 def self.licensed_pictures scroll_panels
43 Panel.licensed_pictures scroll_panels.select {|sp| sp.panel }.map {|sp| sp.panel }
47 return nil if self.scroll_id == nil or self.panel_id == nil
48 self.scroll.own?(operators) and self.panel.usable?(operators)