File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 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
5353 _ct . with_advisory_lock do
5454 delete_hierarchy_references
5555 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! }
5757 end
5858 end
5959 true # don't prevent destruction
@@ -79,7 +79,7 @@ def rebuild!(called_by_rebuild = false)
7979 _ct_reorder_siblings if !called_by_rebuild
8080 end
8181
82- children . each { |c | c . rebuild! ( true ) }
82+ children . find_each { |c | c . rebuild! ( true ) }
8383
8484 _ct_reorder_children if _ct . order_is_numeric? && children . present?
8585 end
@@ -110,7 +110,7 @@ module ClassMethods
110110 def rebuild!
111111 _ct . with_advisory_lock do
112112 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.
114114 end
115115 nil
116116 end
You can’t perform that action at this time.
0 commit comments