about summary refs log tree commit diff
path: root/app/services/delete_account_service.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-08-08 15:29:57 +0200
committerGitHub <noreply@github.com>2021-08-08 15:29:57 +0200
commit763ab0c7eb5430235ca8a354d11e00de1d8ba6dd (patch)
tree424b1ab20882facd51ef8e1140381b6cf56e850f /app/services/delete_account_service.rb
parent818e0b314fc81005dc9a73b53331f75ad52daa0d (diff)
Fix owned account notes not being deleted when an account is deleted (#16579)
* Add account_notes relationship

* Add tests

* Fix owned account notes not being deleted when an account is deleted

* Add post-migration to clean up orphaned account notes
Diffstat (limited to 'app/services/delete_account_service.rb')
-rw-r--r--app/services/delete_account_service.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/services/delete_account_service.rb b/app/services/delete_account_service.rb
index 182f0e127..d8270498a 100644
--- a/app/services/delete_account_service.rb
+++ b/app/services/delete_account_service.rb
@@ -4,6 +4,7 @@ class DeleteAccountService < BaseService
   include Payloadable
 
   ASSOCIATIONS_ON_SUSPEND = %w(
+    account_notes
     account_pins
     active_relationships
     aliases
@@ -34,6 +35,7 @@ class DeleteAccountService < BaseService
   # by foreign keys, making them safe to delete without loading
   # into memory
   ASSOCIATIONS_WITHOUT_SIDE_EFFECTS = %w(
+    account_notes
     account_pins
     aliases
     conversation_mutes