Suppose I have the following setup in my Rails4 app:
A Student has_many
degrees, a Degree belongs_to
a Student. I have a StudentPresenter and a DegreePresenter corresponding to both models as well. (Presenters as defined here)
I want to query the following:
student_ids = [1,2,3,4]
students = Student.where(id: student_ids).includes(:degrees)
But I want to have access to the Presenter methods for both Student and Degree.
How do I preload data with Presenters?
Rails 4.1.5