OSDN Git Service

temp
[pettanr/pettanr.git] / app / models / story_sheet.rb
index 0f493b1..08eac83 100644 (file)
@@ -1,4 +1,4 @@
-class StorySheet < ActiveRecord::Base
+class StorySheet < Pettanr::Item
   belongs_to :author
   belongs_to :story
   belongs_to :sheet
@@ -8,6 +8,18 @@ class StorySheet < ActiveRecord::Base
   validates :author_id, :presence => true, :numericality => true, :existence => {:both => false}
   validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
   
+  def self.singular
+    'StorySheet'
+  end
+  
+  def self.plural
+    'StorySheets'
+  end
+  
+  def self.owner_type
+    :author
+  end
+  
   def supply_default
     self.story_id = nil
     self.sheet_id = nil