OSDN Git Service

temp
[pettanr/pettanr.git] / app / models / scroll_panel.rb
index 1860ac1..048c289 100644 (file)
@@ -1,4 +1,4 @@
-class ScrollPanel < ActiveRecord::Base
+class ScrollPanel < Pettanr::Item
   belongs_to :author
   belongs_to :panel
   belongs_to :scroll
@@ -8,23 +8,16 @@ class ScrollPanel < ActiveRecord::Base
   validates :author_id, :presence => true, :numericality => true, :existence => {:both => false}
   validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
   
-  cattr_reader :singular, :plural
-  @@singular = 'ScrollPanel'
-  @@plural = 'ScrollPanels'
-  def self.item_name
-    self.singular.underscore
+  def self.singular
+    'ScrollPanel'
   end
   
-  def item_name
-    self.class.item_name
+  def self.plural
+    'ScrollPanels'
   end
   
-  def self.path_name with_engine = false
-    self.plural.underscore
-  end
-  
-  def path_name 
-    self.class.path_name
+  def self.owner_type
+    :author
   end
   
   def supply_default