Fix page_part creation when design is changed

This commit is contained in:
chris 2012-10-16 14:17:12 +08:00
parent cbfa659928
commit 68bc4c1874
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class Page < Item
protected protected
def create_parts def create_parts
if self.new_record? || self.design.changed? if self.new_record? || self.design_id_changed?
page_design = self.design page_design = self.design
parent = self.parent parent = self.parent
menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent