optimisations (cut down on category queries, cut down on expensive current_user query)
This commit is contained in:
parent
98d9f174ae
commit
d68e3f7369
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue