This project is archived and is in readonly mode.
Changeset [91fec0d24d50d3b3e90c48b2501ca913544781cc] by Neeraj Singh
September 5th, 2010 @ 12:13 PM
order should always be concatenated.
order that is declared first has highest priority in all cases.
Here are some examples.
Car.order('name desc').find(:first, :order => 'id').name
Car.named_scope_with_order.named_scope_with_another_order
Car.order('id DESC').scoping do
Car.find(:first, :order => 'id asc') end
No special treatment to with_scope or scoping.
Also note that if default_scope declares an order then the
order
declared in default_scope has the highest priority unless
with_exclusive_scope is used.
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
http://github.com/rails/rails/commit/91fec0d24d50d3b3e90c48b2501ca9...
Committed by Neeraj Singh
- M activerecord/lib/active_record/relation/spawn_methods.rb
- M activerecord/test/cases/base_test.rb
- M activerecord/test/cases/relation_scoping_test.rb
- M activerecord/test/cases/relations_test.rb
- M activerecord/test/fixtures/cars.yml
- M activerecord/test/models/car.rb
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>