end
end
+require 'awesome_nested_set/version'
+
module CollectiveIdea
module Acts
module NestedSet
new_record? || leaf_without_new_record?
end
alias_method_chain :leaf?, :new_record
+ # Reload is needed because children may have updated
+ # their parent (self) during deletion.
+ if ::AwesomeNestedSet::VERSION > "2.1.6"
+ module Prunable
+ def destroy_descendants_with_reload
+ destroy_descendants_without_reload
+ reload
+ end
+ alias_method_chain :destroy_descendants, :reload
+ end
+ else
+ def destroy_descendants_with_reload
+ destroy_descendants_without_reload
+ reload
+ end
+ alias_method_chain :destroy_descendants, :reload
+ end
end
end
end
["#{quoted_right_column_name} = (#{quoted_right_column_name} - ?)", diff]
)
- # Reload is needed because children may have updated their parent (self) during deletion.
- reload
# Don't allow multiple calls to destroy to corrupt the set
self.skip_before_destroy = true
end