PERF: Simplify topic serialization for user summary page (#11236)

ListableTopicSerializer includes many attributes which we are not using, and is likely to cause N+1s when not used in conjunction with TopicQuery.
Using the BasicTopicSerializer means that no other tables are required.
This commit is contained in:
David Taylor 2020-11-17 12:07:16 +00:00 committed by GitHub
parent 1a41a1cc43
commit cac7ea35cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2,8 +2,8 @@
class UserSummarySerializer < ApplicationSerializer
class TopicSerializer < ListableTopicSerializer
attributes :category_id, :like_count
class TopicSerializer < BasicTopicSerializer
attributes :category_id, :like_count, :created_at
end
class ReplySerializer < ApplicationSerializer