PERF: Fix N+1 queries in SiteSerialier. (#14365)
`SiteSerializer#groups` loads `Group#flair_upload` for each group so
we need to eagerload this.
Follow-up to e8a9917db1
This commit is contained in:
parent
da88cad648
commit
903439a14e
|
@ -124,7 +124,9 @@ class Site
|
|||
end
|
||||
|
||||
def groups
|
||||
Group.visible_groups(@guardian.user, "name ASC", include_everyone: true)
|
||||
Group
|
||||
.visible_groups(@guardian.user, "name ASC", include_everyone: true)
|
||||
.includes(:flair_upload)
|
||||
end
|
||||
|
||||
def archetypes
|
||||
|
|
Loading…
Reference in New Issue