mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
optimisations (cut down on category queries, cut down on expensive current_user query)
This commit is contained in:
parent
98d9f174ae
commit
d68e3f7369
2 changed files with 2 additions and 2 deletions
|
@ -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 a new issue