Skip to content

Commit 862947d

Browse files
committed
DojosController: Optimize index action by eager loading prefectures
1 parent 5aa23f0 commit 862947d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/dojos_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class DojosController < ApplicationController
33
# GET /dojos[.json]
44
def index
55
@dojos = []
6-
Dojo.order(order: :asc).all.each do |dojo|
6+
Dojo.includes(:prefecture).order(order: :asc).all.each do |dojo|
77
@dojos << {
88
id: dojo.id,
99
url: dojo.url,

0 commit comments

Comments
 (0)