diff options
author | Ernie Miller <ernie@metautonomo.us> | 2010-05-06 16:14:09 -0400 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-05-06 16:00:39 -0700 |
commit | 902861a43ae90032063f4a14a3e8b4b9b9c3ca2f (patch) | |
tree | ca7c3446c4901380f4efd7c21d19cd37ef5f4be6 /activerecord/test | |
parent | 6d7f2790cdb6cb23285067ed2bd91fd5122adbbc (diff) | |
download | rails-902861a43ae90032063f4a14a3e8b4b9b9c3ca2f.tar.gz rails-902861a43ae90032063f4a14a3e8b4b9b9c3ca2f.tar.bz2 rails-902861a43ae90032063f4a14a3e8b4b9b9c3ca2f.zip |
Fix unintuitive behavior with multiple order and group clauses
[#4545 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/cases/base_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 3623680de9..bbc4e543d5 100755 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1994,6 +1994,16 @@ class BasicsTest < ActiveRecord::TestCase assert_equal last, Developer.find(:all, :order => 'developers.name, developers.salary DESC').last end + def test_find_keeps_multiple_order_values + combined = Developer.find(:all, :order => 'developers.name, developers.salary') + assert_equal combined, Developer.find(:all, :order => ['developers.name', 'developers.salary']) + end + + def test_find_keeps_multiple_group_values + combined = Developer.find(:all, :group => 'developers.name, developers.salary, developers.id, developers.created_at, developers.updated_at') + assert_equal combined, Developer.find(:all, :group => ['developers.name', 'developers.salary', 'developers.id', 'developers.created_at', 'developers.updated_at']) + end + def test_find_symbol_ordered_last last = Developer.find :last, :order => :salary assert_equal last, Developer.find(:all, :order => :salary).last |