Commit 6f61a891 by Arjun Singh

Change names to be more consistent

parent b9a7db7e
......@@ -185,19 +185,19 @@ class CommentThread < Content
:updated_at => {:$gte => last_read_time},
:author_id => {:$ne => params[:user_id]},
).count
viewed = last_read_time >= self.updated_at
unread = last_read_time >= self.updated_at
else
unread_count = self.comments.where(:author_id => {:$ne => params[:user_id]}).count
viewed = false
unread = false
end
else
# If there's no user, say it's not viewed and all comments are unread
# If there's no user, say it's unread and all comments are unread
unread_count = comments_count
viewed = false
unread = false
end
doc = doc.merge("unread_comments_count" => unread_count)
.merge("viewed" => viewed)
.merge("unread" => unread)
.merge("comments_count" => comments_count)
doc
......
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