Rename User#delete to User#destroy

"delete" is generally used for immediate SQL deletion without running
any callbacks or other ruby code, whereas "destroy" will trigger callbacks.

Although we don't currently use any callbacks, let's rename this method to
align better with the convention.
This commit is contained in:
Andy Allan 2021-12-22 11:32:33 +00:00
parent bf5f2890ac
commit a863be8831
4 changed files with 7 additions and 7 deletions

View file

@ -241,8 +241,8 @@ class User < ApplicationRecord
end
##
# delete a user - leave the account but purge most personal data
def delete
# destroy a user - leave the account but purge most personal data
def destroy
avatar.purge_later
self.display_name = "user_#{id}"