OSDN Git Service

fix: show's destroy button
[pettanr/pettanr.git] / app / models / resource_picture.rb
index 36d57e5..e087b99 100644 (file)
@@ -222,6 +222,10 @@ class ResourcePicture < Peta::Content
     Base64.encode64(self.restore 'full')
   end
   
+  def new_template
+    "#{self.license_group_module_name.tableize}/attributes/new"
+  end
+  
   def credit_template
     "#{self.license_group_module_name.tableize}/attributes/credit"
   end
@@ -230,4 +234,13 @@ class ResourcePicture < Peta::Content
     "#{self.license_group_module_name.tableize}/attributes/full_credit"
   end
   
+  def self.remake_all
+    ResourcePicture.find(:all).each do |resource_picture|
+      resource_picture.boosts 'post'
+      full = resource_picture.restore 'full'
+      imager = PettanImager.load full
+      resource_picture.store_picture_with_gif(imager)
+    end
+  end
+  
 end