Use Account#targeted_reports association where needed (#35249)
This commit is contained in:
parent
961c22a6fd
commit
06f5f270cc
3 changed files with 3 additions and 3 deletions
|
|
@ -185,7 +185,7 @@ class Admin::AccountAction
|
|||
@reports ||= if type == 'none'
|
||||
with_report? ? [report] : []
|
||||
else
|
||||
Report.where(target_account: target_account).unresolved
|
||||
target_account.targeted_reports.unresolved
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class Form::AccountBatch
|
|||
|
||||
# Suspending a single account closes their associated reports, so
|
||||
# mass-suspending would be consistent.
|
||||
Report.where(target_account: account).unresolved.find_each do |report|
|
||||
account.targeted_reports.unresolved.find_each do |report|
|
||||
authorize(report, :update?)
|
||||
log_action(:resolve, report)
|
||||
report.resolve!(current_account)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue