-class StorySheet < Peta::Content
+class StorySheet < Peta::Leaf
+ load_manifest
belongs_to :author
belongs_to :story
belongs_to :sheet
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 self.owner_model
- Story
- end
-
def supply_default
self.story_id = nil
self.sheet_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_where
+ def self.public_list_where
'stories.visible > 0'
end
Kaminari.paginate_array(Array.new(StorySheet.where(self.play_sheet_where(story.id)).includes(StorySheet.list_opt).count, nil)).page(page).per(1)
end
+ def self.by_author_list_includes
+ {
+ :story => {
+ :comic => {
+ :author => {}
+ }
+ }
+ }
+ end
+
def self.list_opt
{
:author => {},