OSDN Git Service

t#31671:add elm copy
[pettanr/pettanr.git] / app / models / ground_picture.rb
index 4bcd683..f413ae7 100644 (file)
@@ -183,6 +183,14 @@ class GroundPicture < ActiveRecord::Base
     self.panel.remove_element(self, au)
   end
   
+  def copy from_panel
+    r = GroundPicture.new self.attributes
+    r.panel_id = from_panel.id
+    r.t = r.panel.new_t 
+    r.z = r.panel.new_z 
+    r
+  end
+  
   def scenario
     if caption.blank?
       ''