OSDN Git Service

temp
[pettanr/pettanr.git] / app / models / system_picture.rb
index 1d090bc..a9cf03e 100644 (file)
@@ -1,4 +1,4 @@
-class SystemPicture < ActiveRecord::Base
+class SystemPicture < Pettanr::Item
   has_many :balloons
   has_many :balloon_templates
   has_many :licenses
@@ -9,6 +9,18 @@ class SystemPicture < ActiveRecord::Base
   validates :filesize, :presence => true, :numericality => {:greater_than => 0, :less_than_or_equal_to => 2000000}, :natural_number => true
   validates :md5, :presence => true, :length => {:minimum => 32, :maximum => 32}
   
+  def self.singular
+    'SystemPicture'
+  end
+  
+  def self.plural
+    'SystemPictures'
+  end
+  
+  def self.owner_type
+    :author
+  end
+  
   before_destroy :destroy_with_file
   
   def destroy_with_file