diff options
author | Alexander Podgorbunsky <shurikp@evilmartians.com> | 2009-03-26 15:00:12 +0300 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-01 14:44:24 -0700 |
commit | db0bfe4ede3cdfc2e4ccdb2a89525a914e6d0913 (patch) | |
tree | 47b8855b495422578dadda80228e60a48d23c0bb /activerecord/test/cases | |
parent | 853c229bbdb32c27231df8ad0d446bb35e588586 (diff) | |
download | rails-db0bfe4ede3cdfc2e4ccdb2a89525a914e6d0913.tar.gz rails-db0bfe4ede3cdfc2e4ccdb2a89525a914e6d0913.tar.bz2 rails-db0bfe4ede3cdfc2e4ccdb2a89525a914e6d0913.zip |
Default scope :order should be overridden by named scopes.
[#2346 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/method_scoping_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/method_scoping_test.rb b/activerecord/test/cases/method_scoping_test.rb index 2165d2f7e8..c479859ee0 100644 --- a/activerecord/test/cases/method_scoping_test.rb +++ b/activerecord/test/cases/method_scoping_test.rb @@ -628,9 +628,9 @@ class DefaultScopingTest < ActiveRecord::TestCase assert_equal expected, received end - def test_named_scope - expected = Developer.find(:all, :order => 'salary DESC, name DESC').collect { |dev| dev.salary } - received = DeveloperOrderedBySalary.by_name.find(:all).collect { |dev| dev.salary } + def test_named_scope_overwrites_default + expected = Developer.find(:all, :order => 'name DESC').collect { |dev| dev.name } + received = DeveloperOrderedBySalary.by_name.find(:all).collect { |dev| dev.name } assert_equal expected, received end |