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 ''
|
||||||
|
@ -24,5 +25,9 @@ class Layout < DesignFile
|
||||||
self.body = html.at_css("body").inner_html
|
self.body = html.at_css("body").inner_html
|
||||||
parse_body(self)
|
parse_body(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def save_pages
|
||||||
|
self.design.pages.each(&:save)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Reference in New Issue