OSDN Git Service

work
[pettanr/pettanr.git] / app / models / story.rb
index 7a9b829..899ff12 100644 (file)
@@ -8,8 +8,8 @@ class Story < Pettanr::Content
   validates :visible, :presence => true, :numericality => true, :inclusion => {:in => 0..1}
   validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
   
-  def owner_model
-    self.comic
+  def self.owner_model
+    Comic
   end
   
   def self.valid_encode_columns
@@ -156,15 +156,15 @@ class Story < Pettanr::Content
     end
   end
   
-  def allow? au
+  def allow? operators
     return nil if self.comic_id == nil
-    self.comic.own?(au)
+    self.comic.own?(operators)
   end
   
-  def store au, old_t = nil
+  def store operators, old_t = nil
     res = false
     Story.transaction do
-      case self.allow? au
+      case self.allow? operators
       when true
         self.rotate old_t
       when false