aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-06-25 19:34:51 -0300
committerJosé Valim <jose.valim@gmail.com>2010-06-26 00:59:12 +0200
commit65aa6a7db16b7387d5a3bf1ad7f5a602804a2f21 (patch)
treea66aa73a99c67b4828e861a176e5fd7d6b00158f /activerecord/test
parenta2513aea07255877b66b846fcf7ebb35629199df (diff)
downloadrails-65aa6a7db16b7387d5a3bf1ad7f5a602804a2f21.tar.gz
rails-65aa6a7db16b7387d5a3bf1ad7f5a602804a2f21.tar.bz2
rails-65aa6a7db16b7387d5a3bf1ad7f5a602804a2f21.zip
reorder method added to ActiveRelation
[#4972 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relations_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 821b4585a7..d37f7bd09c 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -116,6 +116,12 @@ class RelationTest < ActiveRecord::TestCase
assert_equal topics(:fourth).title, topics.first.title
end
+ def test_finding_with_reorder
+ topics = Topic.order('author_name').order('title').reorder('id')
+ assert_equal 4, topics.to_a.size
+ assert_equal topics(:first).title, topics.first.title
+ end
+
def test_finding_with_order_and_take
entrants = Entrant.order("id ASC").limit(2).to_a