From 91fec0d24d50d3b3e90c48b2501ca913544781cc Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Wed, 1 Sep 2010 12:04:29 -0400 Subject: 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 --- activerecord/test/fixtures/cars.yml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/test/fixtures/cars.yml') diff --git a/activerecord/test/fixtures/cars.yml b/activerecord/test/fixtures/cars.yml index 23c98e8144..b4c748aaa7 100644 --- a/activerecord/test/fixtures/cars.yml +++ b/activerecord/test/fixtures/cars.yml @@ -2,3 +2,8 @@ honda: id: 1 name: honda engines_count: 0 + +zyke: + id: 2 + name: zyke + engines_count: 0 -- cgit v1.2.3