diff options
Diffstat (limited to 'app/services/admin/abuse_reports/moderate_user_service.rb')
-rw-r--r-- | app/services/admin/abuse_reports/moderate_user_service.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/services/admin/abuse_reports/moderate_user_service.rb b/app/services/admin/abuse_reports/moderate_user_service.rb index da61a4dc8f6..823568d9db8 100644 --- a/app/services/admin/abuse_reports/moderate_user_service.rb +++ b/app/services/admin/abuse_reports/moderate_user_service.rb @@ -61,10 +61,17 @@ module Admin def close_report return error('Report already closed') if abuse_report.closed? + close_similar_open_reports abuse_report.closed! success end + def close_similar_open_reports + # admins see the abuse report and other open reports for the same user in one page + # hence, if the request is to close the report, close other open reports for the same user too + abuse_report.similar_open_reports_for_user.update_all(status: 'closed') + end + def close_report_and_record_event event = action |