Let\'s say I have two models: Course and ScheduledCourse.
The Course model has a name attribute.
course has_many :scheduled courses scheduled_courses :belongs_to
ScheduledCourse.joins(:course).order('courses.name asc')
Note that the table name should be in plural. This code is tested.