Update the path when name is changed in item.rb
This commit is contained in:
parent
c8dcc9734d
commit
9982fd880f
|
@ -21,7 +21,7 @@ class Item
|
||||||
validates_associated :parent, :children
|
validates_associated :parent, :children
|
||||||
|
|
||||||
before_destroy :destroy_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)
|
def self.find_by_name(item_name)
|
||||||
|
|
Reference in New Issue