Skip to content

Commit b0b6bdd

Browse files
committed
Fix N+1 query issue by eager loading Companies with People
1 parent bb56d64 commit b0b6bdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/people_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class PeopleController < ApplicationController
22

33
def index
4-
@people = Person.all
4+
@people = Person.includes(:company)
55
end
66

77
def new

0 commit comments

Comments
 (0)