0
0
Fork 0

Fix some notifications not being deleted on poll/status deletion (#15402)

* Fix deleting polls not deleting notifications

* Fix fav notification deletion when deleting a toot

* Refactor DeleteAccountService spec

* Add DeleteAccountService tests for other associations and notifications

* Add favourite handling spec in status removal

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
ThibG 2020-12-21 18:22:17 +01:00 committed by GitHub
parent 6f51fd7435
commit 43961035a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 80 additions and 56 deletions

View file

@ -123,7 +123,9 @@ class DeleteAccountService < BaseService
next if @options[:reserve_username] && reported_status_ids.include?(poll.status_id)
# We can safely delete the poll rather than destroy it, as any non-reported
# status should have been deleted already
# status should have been deleted already, as long as we take care of
# notifications.
Notification.where(poll: poll).delete_all
poll.delete
end