Commit 6ffc09ac by Chris Dodge Committed by Saqib

filter out anonymous posts

parent 75bfffad
...@@ -92,9 +92,9 @@ get "#{APIPREFIX}/users/:user_id/social_stats" do |user_id| ...@@ -92,9 +92,9 @@ get "#{APIPREFIX}/users/:user_id/social_stats" do |user_id|
# get all metadata regarding forum content, but don't bother to fetch the body # get all metadata regarding forum content, but don't bother to fetch the body
# as we don't need it and we shouldn't push all that data over the wire # as we don't need it and we shouldn't push all that data over the wire
if user_id == "*" then if user_id == "*" then
content = Content.where(course_id: course_id).without(:body) content = Content.where(course_id: course_id, anonymous: false, anonymous_to_peers: false).without(:body)
else else
content = Content.where(author_id: user_id, course_id: course_id).without(:body) content = Content.where(author_id: user_id, course_id: course_id, anonymous: false, anonymous_to_peers: false).without(:body)
user_stats[user_id] = { user_stats[user_id] = {
"num_threads" => 0, "num_threads" => 0,
"num_comments" => 0, "num_comments" => 0,
......
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