Update the path when name is changed in item.rb

This commit is contained in:
Christophe Vilayphiou 2012-08-07 11:26:17 +08:00
parent c8dcc9734d
commit 9982fd880f
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class Item
validates_associated :parent, :children
before_destroy :destroy_children
after_rearrange :rebuild_path, :if => "parent_id_changed?"
after_rearrange :rebuild_path, :if => "parent_id_changed? || name_changed?"
def self.find_by_name(item_name)