OSDN Git Service

v07
[pettanr/pettanr.git] / app / models / system_picture.rb
index b89e595..fae8c10 100644 (file)
@@ -1,7 +1,9 @@
-class SystemPicture < Pettanr::Item
+class SystemPicture < Peta::SystemResource
+  load_manifest
   has_many :balloons
   has_many :speech_balloon_templates
   has_many :licenses
+  has_many :writing_formats
   
   validates :ext, :presence => true, :length => {:maximum => 4}, :inclusion => {:in => ['png', 'jpeg', 'gif']}
   validates :width, :presence => true, :numericality => true, :natural_number => true
@@ -11,6 +13,10 @@ class SystemPicture < Pettanr::Item
   
   before_destroy :destroy_with_file
   
+  scope :find_index, -> do
+    self
+  end
+  
   def destroy_with_file
     PictureIO.system_picture_io.delete self.filename
   end
@@ -46,30 +52,10 @@ class SystemPicture < Pettanr::Item
     self.tmb_opt_img_tag
   end
   
-  def self.list_where
-    nil
-  end
-  
-  def self.list_order
-    'system_pictures.updated_at desc'
-  end
-  
-  def self.list_opt
-    {}
-  end
-  
-  def self.list_json_opt
-    {}
-  end
-  
   def self.show_opt
     {}
   end
   
-  def self.show_json_opt
-    {}
-  end
-  
   def store(imager)
     unless imager
       self.errors.add :base, 'illegal picture data'