Updated SuspendAccountService to resolve outstanding reports on suspend

• Updated:
- SuspendAccountService to resolve outstanding reports on suspend
This commit is contained in:
Developer 2021-02-19 12:31:52 -05:00
parent b7d6d5f18c
commit 32ac987ef0
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,7 @@ class SuspendAccountService < BaseService
purge_user! purge_user!
purge_profile! purge_profile!
purge_content! purge_content!
resolve_reports!
end end
private private
@ -99,6 +100,10 @@ class SuspendAccountService < BaseService
@account.save! @account.save!
end end
def resolve_reports!
Report.where(target_account: @account).unresolved.update_all(action_taken: true) unless @options[:destroy]
end
def destroy_all(association) def destroy_all(association)
association.in_batches.destroy_all association.in_batches.destroy_all
end end