File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def _ct_before_destroy
53
53
_ct . with_advisory_lock do
54
54
delete_hierarchy_references
55
55
if _ct . options [ :dependent ] == :nullify
56
- self . class . find ( self . id ) . children . each { |c | c . rebuild! }
56
+ self . class . find ( self . id ) . children . find_each { |c | c . rebuild! }
57
57
end
58
58
end
59
59
true # don't prevent destruction
@@ -79,7 +79,7 @@ def rebuild!(called_by_rebuild = false)
79
79
_ct_reorder_siblings if !called_by_rebuild
80
80
end
81
81
82
- children . each { |c | c . rebuild! ( true ) }
82
+ children . find_each { |c | c . rebuild! ( true ) }
83
83
84
84
_ct_reorder_children if _ct . order_is_numeric? && children . present?
85
85
end
@@ -110,7 +110,7 @@ module ClassMethods
110
110
def rebuild!
111
111
_ct . with_advisory_lock do
112
112
hierarchy_class . delete_all # not destroy_all -- we just want a simple truncate.
113
- roots . each { |n | n . send ( :rebuild! ) } # roots just uses the parent_id column, so this is safe.
113
+ roots . find_each { |n | n . send ( :rebuild! ) } # roots just uses the parent_id column, so this is safe.
114
114
end
115
115
nil
116
116
end
You can’t perform that action at this time.
0 commit comments