mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-02 10:09:51 -04:00
PERF: omit needless query
This commit is contained in:
parent
aefedfafea
commit
edfd870249
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ class PostAction < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.counts_for(collection, user)
|
||||
return {} if collection.blank?
|
||||
return {} if collection.blank? || !user
|
||||
|
||||
collection_ids = collection.map(&:id)
|
||||
user_id = user.try(:id) || 0
|
||||
|
|
Loading…
Add table
Reference in a new issue