From a9aa1dd150a1236d54c81a7556ed459caf9567af Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 18 Feb 2013 18:21:33 +0800 Subject: [PATCH] Fix for path renaming --- app/models/item.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/item.rb b/app/models/item.rb index 17880e4a..a149358f 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