2 class Story < Peta::Binder
4 has_many :comic_stories
8 validates :title, :presence => true, :length => {:maximum => 100}
9 validates :visible, :presence => true, :numericality => true, :inclusion => {:in => 0..1}
10 validates :author_id, :presence => true, :numericality => true, :existence => {:both => false}
13 self.visible = 0 if self.visible.blank?
17 def overwrite operators
18 return false unless operators.author
19 self.author_id = operators.author.id
23 def visible? operators
25 when nil # super return
34 def self.public_list_where list
39 {:include => {:story_sheets => {:sheet => {}}, :author => {}}}