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?
|
||||
# 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
|
||||
|
|
Loading…
Reference in New Issue