Commit a075f5d9 by Rocky Duan

return preprocessed thread data for recent_active

parent 370dd7e2
...@@ -78,7 +78,7 @@ get "#{APIPREFIX}/search/threads/recent_active" do ...@@ -78,7 +78,7 @@ get "#{APIPREFIX}/search/threads/recent_active" do
CommentThread.all.where(query_params.merge(:last_activity_at => {:$gte => from_time})) CommentThread.all.where(query_params.merge(:last_activity_at => {:$gte => from_time}))
end end
comment_threads.to_a.sort {|x, y| y.last_activity_at <=> x.last_activity_at}[0..4].to_json comment_threads.to_a.sort {|x, y| y.last_activity_at <=> x.last_activity_at}[0..4].map(&:to_hash).to_json
end end
......
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