Let’s say I have
class Student < ActiveRecord::Base
has_many :classes, :through => :classes_students
I want the list of classes for each student to be sorted by the class
I could get an array containing the classes and then sort it. But, I
would like for the database to do the work.
Is there some combination of :include and :order that would cause
rails to ask for a sorted list?
I know this does not work:
has_many :classes, :through => :classes_students, :order => ‘title’