OSDN Git Service

fix:element remove func failed
[pettanr/pettanr.git] / lib / peta / element_nestable_content.rb
index 7ee2e9f..df9884b 100644 (file)
@@ -21,6 +21,17 @@ module Peta
     
     # Class Methods
     
+    def self.permit_attributes default_permit_attributes = []
+      attrs = super
+      self.child_models.each do |element_model|
+        name = self.my_manifest.associations.child_element_name(element_model) + '_attributes'
+        child_attrs = {}
+        child_attrs[name] = element_model.permit_attributes(default_permit_attributes)
+        attrs.push child_attrs
+      end
+      attrs
+    end
+    
     # Instance Methods
     
     def boosts level