:delete_all is much faster than :destroy_all, it doesn't trigger any destroy callbacks on the associated object.
:destroy_all iteratively call the associated objects's destroy method
:destroy_all iteratively call the associated objects's destroy method
本文探讨了在数据库操作中使用delete_all与destroy_all的区别。delete_all操作比destroy_all更快,因为它不会触发任何销毁回调。而destroy_all则会逐个调用关联对象的销毁方法。
5534

被折叠的 条评论
为什么被折叠?



