Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c1bf707

Browse files
committed
PERF: N+1 queries on badges page.
1 parent ec57ca5 commit c1bf707

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/badges_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def index
1414
if (params[:only_listable] == "true") || !request.xhr?
1515
# NOTE: this is sorted client side if needed
1616
badges = badges.includes(:badge_grouping)
17+
.includes(:badge_type)
1718
.where(enabled: true, listable: true)
18-
1919
end
2020

2121
badges = badges.to_a

0 commit comments

Comments
 (0)