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
|
embeds_many :layout_parts
|
||||||
|
|
||||||
before_save :parse_layout
|
before_save :parse_layout
|
||||||
|
after_save :save_pages
|
||||||
|
|
||||||
def content
|
def content
|
||||||
self.file.read.force_encoding("UTF-8") rescue ''
|
self.file.read.force_encoding("UTF-8") rescue ''
|
||||||
|
@ -25,4 +26,8 @@ class Layout < DesignFile
|
||||||
parse_body(self)
|
parse_body(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def save_pages
|
||||||
|
self.design.pages.each(&:save)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue