1 class StorySheet < Peta::Leaf
7 validates :story_id, :presence => true, :numericality => true, :existence => {:both => false}
8 validates :sheet_id, :presence => true, :numericality => true, :existence => {:both => false}
9 validates :author_id, :presence => true, :numericality => true, :existence => {:both => false}
10 validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
18 def overwrite operators
19 return false unless operators.author
20 self.author_id = operators.author.id
23 def self.public_list_where
27 def self.by_author_list_includes
46 return nil if self.story_id == nil or self.sheet_id == nil
47 self.story.own?(operators) and self.sheet.usable?(operators)