Given the following AR models, I would like to sort users alphabetically by last name when given a handle to a task:
#user has_many :assignments has_many :ta
Rails 3.x version:
has_many :users, :through => :assignments, :order => 'users.last_name, users.first_name'
UPDATE: This only works in Rails 3.x (maybe before that too). For 4+, see other answers.