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