Fix previous commit
This commit is contained in:
parent
6543491a53
commit
bdcfb46294
|
@ -27,7 +27,7 @@ class Layout < DesignFile
|
|||
end
|
||||
|
||||
def save_pages
|
||||
self.design.pages.each(&:save)
|
||||
self.design.pages.each(&:generate_parts)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -26,10 +26,7 @@ class Page < Item
|
|||
|
||||
# embeds_many :custom_images, :class_name => 'Image', as: :design_image
|
||||
|
||||
protected
|
||||
|
||||
def create_parts
|
||||
if self.new_record? || self.design_id_changed?
|
||||
def generate_parts
|
||||
page_design = self.design
|
||||
parent = self.parent
|
||||
menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent
|
||||
|
@ -47,6 +44,13 @@ class Page < Item
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def create_parts
|
||||
if self.new_record? || self.design_id_changed?
|
||||
generate_parts
|
||||
end
|
||||
end
|
||||
|
||||
def delete_empty_frontend_field
|
||||
|
|
Reference in New Issue