How to do find() with includes() in Rails 3

Viewed 32088

I'm trying to do something like this, but it's not working. How would I do this in Rails 3?

Student.find(12).includes(:teacher)
4 Answers

There is no sense to use find with includes. Eager loading helps us to load the associated records of the objects to prevent n+1 problem. With only one record you will never experience n+1 problem.

Related