added best=N option to get N best comment on a post

This commit is contained in:
Sam
2013-03-27 22:53:11 -07:00
parent e263cb81ca
commit 2295290383
4 changed files with 32 additions and 13 deletions

View File

@ -71,7 +71,7 @@ class PostsController < ApplicationController
post_serializer.draft_sequence = DraftSequence.current(current_user, post.topic.draft_key)
link_counts = TopicLinkClick.counts_for(post.topic, [post])
post_serializer.single_post_link_counts = link_counts[post.id] if link_counts.present?
post_serializer.topic_slug = post.topic.slug if post.topic.present?
result = {post: post_serializer.as_json}
if revisor.category_changed.present?