reading that default attribute on inheriting editable_elements and calling the method on that page (instead of getting it from the parent)
This commit is contained in:
parent
ea81025d33
commit
97e3ddb6e3
@ -68,7 +68,11 @@ module Models
|
|||||||
|
|
||||||
if existing_el.nil? # new one from parents
|
if existing_el.nil? # new one from parents
|
||||||
new_attributes = el.attributes.merge(:from_parent => true)
|
new_attributes = el.attributes.merge(:from_parent => true)
|
||||||
new_attributes[:default_content] = el.content
|
if new_attributes['default_attribute'].present?
|
||||||
|
new_attributes['default_content'] = self.send(new_attributes['default_attribute']) || el.content
|
||||||
|
else
|
||||||
|
new_attributes['default_content'] = el.content
|
||||||
|
end
|
||||||
|
|
||||||
self.editable_elements.build(new_attributes, el.class)
|
self.editable_elements.build(new_attributes, el.class)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user