Updated SuspendAccountService to resolve outstanding reports on suspend
• Updated: - SuspendAccountService to resolve outstanding reports on suspend
This commit is contained in:
parent
b7d6d5f18c
commit
32ac987ef0
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue