Commit 3602ec58 by Ibrahim Awwal

Don't count anonymous posts in thread/comment counts.

parent e055340e
......@@ -68,8 +68,8 @@ class User
)
end
if params[:course_id]
hash = hash.merge("threads_count" => CommentThread.where(author_id: id, course_id: params[:course_id]).count,
"comments_count" => Comment.where(author_id: id, course_id: params[:course_id]).count
hash = hash.merge("threads_count" => CommentThread.where(author_id: id,course_id: params[:course_id], anonymous: false, anonymous_to_peers: false).count,
"comments_count" => Comment.where(author_id: id, course_id: params[:course_id], anonymous: false, anonymous_to_peers: false).count
)
end
hash
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment