aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-03-10 23:11:05 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-03-10 23:11:05 -0700
commit19ad375e7afa99dc8bc5d859c478bae19c5ddc18 (patch)
treef5b1c4776ad408e9445b3c54fbe35588243ac0c2 /activerecord/test
parentcfde60575a646549b47990befc037fa73a9dc393 (diff)
downloadrails-19ad375e7afa99dc8bc5d859c478bae19c5ddc18.tar.gz
rails-19ad375e7afa99dc8bc5d859c478bae19c5ddc18.tar.bz2
rails-19ad375e7afa99dc8bc5d859c478bae19c5ddc18.zip
Don't duplicate :order from scope and options, it makes mysql do extra work
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/method_scoping_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/method_scoping_test.rb b/activerecord/test/cases/method_scoping_test.rb
index 68a7017f86..3c34cdeade 100644
--- a/activerecord/test/cases/method_scoping_test.rb
+++ b/activerecord/test/cases/method_scoping_test.rb
@@ -378,8 +378,10 @@ class NestedScopingTest < ActiveRecord::TestCase
def test_merged_scoped_find
poor_jamis = developers(:poor_jamis)
Developer.with_scope(:find => { :conditions => "salary < 100000" }) do
- Developer.with_scope(:find => { :offset => 1 }) do
- assert_equal(poor_jamis, Developer.find(:first, :order => 'id asc'))
+ Developer.with_scope(:find => { :offset => 1, :order => 'id asc' }) do
+ assert_sql /ORDER BY id asc / do
+ assert_equal(poor_jamis, Developer.find(:first, :order => 'id asc'))
+ end
end
end
end