diff --git a/app/models/item.rb b/app/models/item.rb index 17880e4a4..a149358f8 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -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