From b049e16634437b6a5bc2ed8c04e6ff924a7008d9 Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 6 Feb 2013 21:05:17 +0800 Subject: [PATCH] Create part and save pages when layout is edited --- app/models/page.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/page.rb b/app/models/page.rb index bc257eaa1..1f13d64cf 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -27,6 +27,11 @@ class Page < Item before_save :create_parts, if: Proc.new { |page| page.new_record? || page.design_id_changed? } before_save :delete_empty_frontend_field, :generate_html + def generate_parts + create_parts + self.save + end + protected def create_parts