mirror of
https://github.com/discourse/discourse.git
synced 2025-04-01 18:47:55 +08:00
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
|
end
|
||||||
|
|
||||||
def reply_count
|
def reply_count
|
||||||
object.posts.where("post_number > 1").count
|
object.topic_reply_count
|
||||||
end
|
end
|
||||||
|
|
||||||
def site_flagged_posts_count
|
def site_flagged_posts_count
|
||||||
|
@ -14,7 +14,7 @@ class TopicListItemSerializer < ListableTopicSerializer
|
|||||||
:rank_details,
|
:rank_details,
|
||||||
:excerpt
|
:excerpt
|
||||||
|
|
||||||
has_one :category
|
has_one :category, serializer: BasicCategorySerializer
|
||||||
has_many :posters, serializer: TopicPosterSerializer, embed: :objects
|
has_many :posters, serializer: TopicPosterSerializer, embed: :objects
|
||||||
|
|
||||||
def starred
|
def starred
|
||||||
|
Loading…
x
Reference in New Issue
Block a user