OSDN Git Service

fix: op upload and destroy
[pettanr/pettanr.git] / lib / peta / root.rb
index c0a3887..4a93924 100644 (file)
@@ -133,24 +133,18 @@ module Peta
       res
     end
     
-    def destroy_with_elements
+    def destroy
       res = false
       self.class.transaction do
         self.parts_element.each do |element|
           raise ActiveRecord::Rollback unless element.destroy
         end
-        raise ActiveRecord::Rollback unless self.destroy
-        res = true
+        res = super
+        raise ActiveRecord::Rollback unless res
       end
       res
     end
     
-    def self.panelize panel
-      attr = panel.attributes
-      attr.delete 'id'
-      attr
-    end
-    
   end
 end