1 class ComicStory < Peta::Leaf
7 validates :comic_id, :presence => true, :numericality => true, :existence => {:both => false}
8 validates :story_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
28 I18n.t('comic_stories.show.t', :t => self.disp_t)
32 self.disp_t_by_text + ':' + self.story.title
35 def self.public_list_where
39 def self.by_author_list_includes
56 return nil if self.story_id == nil or self.comic_id == nil
57 self.comic.own?(operators) and self.story.own?(operators)