lib/cachai.rb in cachai-0.0.4 vs lib/cachai.rb in cachai-0.0.5
- old
+ new
@@ -136,11 +136,11 @@
json_list
end
def get_and_sort_comments_for(post)
result = []
- top_level = post.responses.comment.top_level
- nested = post.responses.comment.nested
+ top_level = post.responses.comment.approved.top_level
+ nested = post.responses.comment.approved.nested
top_level.each_with_index do |comment, i|
obj = comment.as_json
children = nested.select do |nested|
nested.parent_id == comment.id