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:
@ -81,7 +81,7 @@ class BatchedRemoveStatusService < BaseService
|
||||
redis.publish('timeline:public', payload)
|
||||
redis.publish('timeline:public:local', payload) if status.local?
|
||||
|
||||
if status.media_attachments.exists?
|
||||
if status.media_attachments.any?
|
||||
redis.publish('timeline:public:media', payload)
|
||||
redis.publish('timeline:public:local:media', payload) if status.local?
|
||||
end
|
||||
|
Reference in New Issue
Block a user