Skip to content

Commit e22bc25

Browse files
committedJul 20, 2013
fix for issue #68
1 parent 4ca376d commit e22bc25

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed
 

‎lib/closure_tree/hierarchy_maintenance.rb

+13-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def rebuild!
5959
SQL
6060
end
6161
# Resetting the ancestral collections addresses https://github.com/mceachen/closure_tree/issues/68
62-
self.ancestor_hierarchies.reset
63-
self.self_and_ancestors.reset
62+
self.ancestor_hierarchies._ct_reset
63+
self.self_and_ancestors._ct_reset
6464
children.each { |c| c.rebuild! }
6565
_ct_reorder_children if _ct.order_is_numeric?
6666
end
@@ -98,3 +98,14 @@ def rebuild!
9898
end
9999
end
100100
end
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+
end
110+
end
111+
end

0 commit comments

Comments
 (0)