Save pages to generate page_parts when a layout is updated
This commit is contained in:
parent
036d7bbb0e
commit
6543491a53
|
@ -10,6 +10,7 @@ class Layout < DesignFile
|
|||
embeds_many :layout_parts
|
||||
|
||||
before_save :parse_layout
|
||||
after_save :save_pages
|
||||
|
||||
def content
|
||||
self.file.read.force_encoding("UTF-8") rescue ''
|
||||
|
@ -25,4 +26,8 @@ class Layout < DesignFile
|
|||
parse_body(self)
|
||||
end
|
||||
|
||||
def save_pages
|
||||
self.design.pages.each(&:save)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Reference in New Issue