mirror of
https://github.com/discourse/discourse.git
synced 2025-03-31 08:25:53 +08:00
FIX: frequent posters wasn't displaying the correct information
This commit is contained in:
parent
469c6776c6
commit
47e79570cc
@ -277,7 +277,9 @@ class TopicView
|
||||
|
||||
def post_counts_by_user
|
||||
@post_counts_by_user ||= begin
|
||||
return {} if @posts.blank?
|
||||
post_ids = unfiltered_posts.pluck(:id)
|
||||
|
||||
return {} if post_ids.blank?
|
||||
|
||||
sql = <<~SQL
|
||||
SELECT user_id, count(*) AS count_all
|
||||
@ -289,7 +291,7 @@ class TopicView
|
||||
LIMIT 24
|
||||
SQL
|
||||
|
||||
Hash[Post.exec_sql(sql, post_ids: @posts.pluck(:id)).values]
|
||||
Hash[Post.exec_sql(sql, post_ids: post_ids).values]
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user