OSDN Git Service

fix anything
[pettanr/pettanr.git] / app / models / story.rb
index 9153230..2d09d53 100644 (file)
@@ -1,5 +1,5 @@
 #ストーリー
-class Story < Peta::Content
+class Story < Peta::Binder
   load_manifest
   has_many :story_sheets
   belongs_to :comic
@@ -9,11 +9,6 @@ class Story < Peta::Content
   validates :visible, :presence => true, :numericality => true, :inclusion => {:in => 0..1}
   validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
   
-  def tag_attributes column = nil, opt = {}
-    {
-    }
-  end
-  
   def supply_default
     self.comic_id = nil
     self.visible = 0 if self.visible.blank?
@@ -25,7 +20,7 @@ class Story < Peta::Content
   
   def visible? operators
     return false unless super
-    self.owner_model.visible? operators
+    self.visible > 0
   end
   
   def disp_t
@@ -44,7 +39,7 @@ class Story < Peta::Content
     StorySheet.where(['story_sheets.story_id = ?', self.id]).count
   end
   
-  def self.list_where
+  def self.public_list_where
     'stories.visible > 0'
   end
   
@@ -56,6 +51,14 @@ class Story < Peta::Content
     {:comic => {:author => {}} }
   end
   
+  def self.by_author_list_includes
+    {
+      :comic => {
+        :author => {}
+      }
+    }
+  end
+  
   def self.list_json_opt
     {:include => {:comic => {:include => {:author => {}}} }}
   end