Use #any? instead of #exists? when checking media attachments (#7570)
If media_attachments are not loaded, SQL query is the same, but the #exists? method performs SQL query even if preloaded
This commit is contained in:
@ -25,7 +25,7 @@ class FanOutOnWriteService < BaseService
|
||||
return if status.reply? && status.in_reply_to_account_id != status.account_id
|
||||
|
||||
deliver_to_public(status)
|
||||
deliver_to_media(status) if status.media_attachments.exists?
|
||||
deliver_to_media(status) if status.media_attachments.any?
|
||||
end
|
||||
|
||||
private
|
||||
|
Reference in New Issue
Block a user