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:
parent
1a41a1cc43
commit
cac7ea35cf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue