mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: N+1 queries on badges page.
This commit is contained in:
parent
ec57ca54b5
commit
c1bf707e7d
@ -14,8 +14,8 @@ class BadgesController < ApplicationController
|
|||||||
if (params[:only_listable] == "true") || !request.xhr?
|
if (params[:only_listable] == "true") || !request.xhr?
|
||||||
# NOTE: this is sorted client side if needed
|
# NOTE: this is sorted client side if needed
|
||||||
badges = badges.includes(:badge_grouping)
|
badges = badges.includes(:badge_grouping)
|
||||||
|
.includes(:badge_type)
|
||||||
.where(enabled: true, listable: true)
|
.where(enabled: true, listable: true)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
badges = badges.to_a
|
badges = badges.to_a
|
||||||
|
Loading…
Reference in New Issue
Block a user