Add warnings to report action logs (#27425)

main
Claire 2023-10-23 14:30:46 +02:00 committed by GitHub
parent 44edf3aa91
commit 8b770ce811
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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))