diff options
author | Miguel Grazziotin <miguelgraz@gmail.com> | 2015-06-05 17:18:03 -0300 |
---|---|---|
committer | Miguel Grazziotin <miguelgraz@gmail.com> | 2015-06-05 17:18:03 -0300 |
commit | 2eb6b9dd0ba5049ee3a94f2f7ec7aa2fadd69dfc (patch) | |
tree | bb9e61043f89d41353ea7a575e722ea213581394 /activerecord/test | |
parent | 4e63a7b4b051aa8dc7ae53f46ea27cf421863561 (diff) | |
download | rails-2eb6b9dd0ba5049ee3a94f2f7ec7aa2fadd69dfc.tar.gz rails-2eb6b9dd0ba5049ee3a94f2f7ec7aa2fadd69dfc.tar.bz2 rails-2eb6b9dd0ba5049ee3a94f2f7ec7aa2fadd69dfc.zip |
do not change the order of the result if the object was already ordered by the user via :order clause
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index 3ea1299b1c..1ab91c5195 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -76,6 +76,11 @@ class FinderTest < ActiveRecord::TestCase assert_equal 'The Third Topic of the day', records[0].title assert_equal 'The First Topic', records[1].title assert_equal 'The Fifth Topic of the day', records[2].title + + records = Topic.order(:id).find([5,3,1]) + assert_equal 'The First Topic', records[0].title + assert_equal 'The Third Topic of the day', records[1].title + assert_equal 'The Fifth Topic of the day', records[2].title end def test_find_with_ids_and_limit |