mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: omit needless query
This commit is contained in:
parent
aefedfafea
commit
edfd870249
@ -66,7 +66,7 @@ class PostAction < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.counts_for(collection, user)
|
def self.counts_for(collection, user)
|
||||||
return {} if collection.blank?
|
return {} if collection.blank? || !user
|
||||||
|
|
||||||
collection_ids = collection.map(&:id)
|
collection_ids = collection.map(&:id)
|
||||||
user_id = user.try(:id) || 0
|
user_id = user.try(:id) || 0
|
||||||
|
Loading…
Reference in New Issue
Block a user