mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 16:40:01 +08:00
FIX: use BasicUserSerializer for user_badge.granted_by (#6266)
BasicUserSerializer contains enough information for the badges page, while UserSerializer issues ~100 SQL queries on the fly when serializing the field without preloading.
This commit is contained in:
parent
71b65be6f6
commit
983dba37ce
|
@ -1,5 +1,5 @@
|
|||
class DetailedUserBadgeSerializer < BasicUserBadgeSerializer
|
||||
has_one :granted_by
|
||||
has_one :granted_by, serializer: UserBadgeSerializer::UserSerializer
|
||||
|
||||
attributes :post_number, :topic_id, :topic_title
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user