Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Changeset [91fec0d24d50d3b3e90c48b2501ca913544781cc] by Neeraj Singh

Revision 91fec0d24d50d3b3e90c48b2501ca913544781cc, committed 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...

6 changed files

  • 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