BUGFIX: likes would cause whole post to re-render

This commit is contained in:
Sam
2014-04-24 12:42:04 +10:00
parent 2d123ef1c7
commit 05efc8df16
7 changed files with 46 additions and 6 deletions

View File

@ -218,6 +218,8 @@ class PostsController < ApplicationController
def render_post_json(post)
post_serializer = PostSerializer.new(post, scope: guardian, root: false)
post_serializer.add_raw = true
post_serializer.topic_slug = post.topic.slug if post.topic.present?
counts = PostAction.counts_for([post], current_user)
if counts && counts = counts[post.id]
post_serializer.post_actions = counts