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
Since condition arguments are deprecated in Rails 4, one should use scope blocks:
has_many :users, -> { order 'users.last_name, users.first_name' }, :through => :assignments