Create part and save pages when layout is edited

This commit is contained in:
chris 2013-02-06 21:05:17 +08:00
parent c27141ff5a
commit b049e16634
1 changed files with 5 additions and 0 deletions

View File

@ -27,6 +27,11 @@ class Page < Item
before_save :create_parts, if: Proc.new { |page| page.new_record? || page.design_id_changed? } before_save :create_parts, if: Proc.new { |page| page.new_record? || page.design_id_changed? }
before_save :delete_empty_frontend_field, :generate_html before_save :delete_empty_frontend_field, :generate_html
def generate_parts
create_parts
self.save
end
protected protected
def create_parts def create_parts