FEATURE: update likes and flags live.

This commit is contained in:
Sam
2014-03-24 13:22:03 +11:00
parent 090f5c99c2
commit 1cd32ced33
3 changed files with 21 additions and 1 deletions

View File

@ -212,6 +212,10 @@ class PostsController < ApplicationController
def render_post_json(post)
post_serializer = PostSerializer.new(post, scope: guardian, root: false)
post_serializer.add_raw = true
counts = PostAction.counts_for([post], current_user)
if counts && counts = counts[post.id]
post_serializer.post_actions = counts
end
render_json_dump(post_serializer)
end