Fix for path renaming

This commit is contained in:
chris committed 2013-02-19 18:09:55 +08:00
1 parent 9e9620c04a
commit a9aa1dd150
1 file changed
+1 -1
+1 -1
View File
@@ -23,6 +23,7 @@ class Item
before_destroy :destroy_children
after_rearrange :rebuild_path, :if => "parent_id_changed? || name_changed?"
after_save :rebuild_children_path, :if => "path_changed?"
def enabled_for_lang(lang)
enabled_for.include?(lang)
@@ -68,7 +69,6 @@ class Item
def rebuild_path
self.path = (self.ancestors_and_self - [Item.root]).collect{|x| x.name unless x.root?}.join('/')
self.rebuild_children_path
end
def rebuild_children_path