Is it possible to sort the list of objects by the property of the associated object?
For example, with the following class
class RosterSlot < ActiveRecord::Base
belongs_to :event
belongs_to :skill
belongs_to :person
end
I want to do something like RosterSlot.find (: all ,: order => skill.name)
which means that activerecord must do the join and order.
Any ideas?
source
share