File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
* Dirkjan Bussink*
4
4
5
- * Prevent double saves in autosave of cyclic associations
5
+ * Relation#destroy_all perform its work in batches
6
6
7
7
Since destroy_all actually loads the entire relation and then iteratively destroys the records one by one,
8
8
you can blow your memory gasket very easily. So let's do the right thing by default
9
9
and do this work in batches of 100 by default and allow you to specify
10
10
the batch size like so: #destroy_all(batch_size: 100).
11
11
12
12
Apps upgrading to 7.0 will get a deprecation warning. As of Rails 7.1, destroy_all will no longer
13
- return the collection of objects that were destroyed.
13
+ return the collection of records that were destroyed.
14
14
15
15
To transition to the new behaviour set the following in an initializer:
16
16
You can’t perform that action at this time.
0 commit comments