We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ca376d commit e22bc25Copy full SHA for e22bc25
lib/closure_tree/hierarchy_maintenance.rb
@@ -59,8 +59,8 @@ def rebuild!
59
SQL
60
end
61
# Resetting the ancestral collections addresses https://github.com/mceachen/closure_tree/issues/68
62
- self.ancestor_hierarchies.reset
63
- self.self_and_ancestors.reset
+ self.ancestor_hierarchies._ct_reset
+ self.self_and_ancestors._ct_reset
64
children.each { |c| c.rebuild! }
65
_ct_reorder_children if _ct.order_is_numeric?
66
@@ -98,3 +98,14 @@ def rebuild!
98
99
100
101
+
102
+# Horrible monkeypatch to address https://github.com/mceachen/closure_tree/issues/68
103
+module ActiveRecord
104
+ module Associations
105
+ class CollectionProxy
106
+ def _ct_reset
107
+ @association.reset
108
+ end
109
110
111
+end
0 commit comments