Reports spec for media attachments, clean up method (#2660)
* Add coverage for Report#media_attachments * Direct query on media attachment
This commit is contained in:
parent
b83bc0ae64
commit
5259319cf5
2 changed files with 12 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue