lib/parentry/strategy/ltree/instance_methods.rb in parentry-0.5.0 vs lib/parentry/strategy/ltree/instance_methods.rb in parentry-1.0.0
- old
+ new
@@ -9,10 +9,10 @@
def compute_parentry
parent.present? ? "#{parent.parentry}.#{id}" : "#{id}"
end
def cascade_parentry
- old_path, new_path = changes[parentry_column]
+ old_path, new_path = saved_changes[parentry_column]
parentry_scope.where(
["#{parentry_column} <@ :tree AND id != :id", tree: old_path, id: id]
).update_all(
[
"#{parentry_column} = :new_path || subpath(#{parentry_column}, nlevel(:old_path))",