OSDN Git Service

fix bucket
[pettanr/pettanr.git] / app / models / story_sheet.rb
index 47750d5..6d02cd0 100644 (file)
@@ -1,4 +1,5 @@
-class StorySheet < Peta::Content
+class StorySheet < Peta::Leaf
+  load_manifest
   belongs_to :author
   belongs_to :story
   belongs_to :sheet
@@ -8,15 +9,6 @@ class StorySheet < Peta::Content
   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
@@ -28,12 +20,7 @@ class StorySheet < Peta::Content
     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
   
@@ -67,6 +54,16 @@ class StorySheet < Peta::Content
     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 => {},