I have these 3 models
- Student
- Gender
- BloodType
- Prefecture
Student has these three models such as Gender, BloodType, Prefecture. and each of them belongs to Student.
Association is set up already in each model files.
In this case, how can I code if I want to avoid N + 1 issue?
Is it something like this?
@students = Student.find(:all).includes.includes(:gender, :blood_type, :prefecture)