From 8b770ce8110e6cd609a6769c66210d95e291e3e5 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 23 Oct 2023 14:30:46 +0200 Subject: [PATCH] Add warnings to report action logs (#27425) --- app/models/report.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/report.rb b/app/models/report.rb index eaf662d1e2..81ad721df1 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -142,6 +142,11 @@ class Report < ApplicationRecord target_type: 'Status', target_id: status_ids ).unscope(:order).arel, + + Admin::ActionLog.where( + target_type: 'AccountWarning', + target_id: AccountWarning.where(report_id: id).select(:id) + ).unscope(:order).arel, ].reduce { |union, query| Arel::Nodes::UnionAll.new(union, query) } Admin::ActionLog.from(Arel::Nodes::As.new(subquery, Admin::ActionLog.arel_table))