From 5259319cf5d01a23a0e9517b9dc91c0a1f7e2ae9 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Sun, 30 Apr 2017 12:15:49 -0400 Subject: Reports spec for media attachments, clean up method (#2660) * Add coverage for Report#media_attachments * Direct query on media attachment --- app/models/report.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'app') diff --git a/app/models/report.rb b/app/models/report.rb index c7d887745..d813d0d0d 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -13,10 +13,6 @@ class Report < ApplicationRecord end def media_attachments - media_attachments = [] - statuses.each do |s| - media_attachments.concat s.media_attachments - end - media_attachments + MediaAttachment.where(status_id: status_ids) end end -- cgit