optimisations (cut down on category queries, cut down on expensive current_user query)

This commit is contained in:
Sam 2013-05-13 11:07:02 +10:00
parent 98d9f174ae
commit d68e3f7369
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ class CurrentUserSerializer < BasicUserSerializer
end
def reply_count
object.posts.where("post_number > 1").count
object.topic_reply_count
end
def site_flagged_posts_count

View file

@ -14,7 +14,7 @@ class TopicListItemSerializer < ListableTopicSerializer
:rank_details,
:excerpt
has_one :category
has_one :category, serializer: BasicCategorySerializer
has_many :posters, serializer: TopicPosterSerializer, embed: :objects
def starred