docbrown/app/models/users
Jeremy Friesen ee0a521a83
Favoring delete_all on user relationships (#15443)
* Favoring delete_all on user relationships

Prior to this commit, several of the user's "has_many" were marked as
`depenedent: :destroy`.

In the case of :destroy, ActiveRecord instantiates each object and then
runs destroy. Whereas in the case of :delete, ActiveRecord issues a SQL
command to delete the related files.

It is often "safer" to use :destroy, as it guarantees that you'll
instantiate the record and run it's callbacks. But sometimes you have
to go with the speed of SQL.

And while not directly related to #15424 it is representative of our
callback ecosystem creating some unexpected computational loads.

Related to #15442 and #15424

* Noting models that user no longer cascade destroys
2021-11-23 11:50:12 -05:00
..
gdpr_delete_request.rb Confirmations that users GDPR data was deleted (#11039) 2020-12-14 12:49:45 +03:00
notification_setting.rb Favoring delete_all on user relationships (#15443) 2021-11-23 11:50:12 -05:00
setting.rb Favoring delete_all on user relationships (#15443) 2021-11-23 11:50:12 -05:00
suspended_username.rb Rename banned and comment_banned roles (#12270) 2021-04-06 10:12:14 -05:00