From 2b17a4d217a69c8221918bd390eb4f33594c8e6a Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 25 Jun 2010 19:22:45 -0300 Subject: [PATCH] Test for concatenated orders added [#4972] --- activerecord/test/cases/relations_test.rb | 6 ++++++ activerecord/test/fixtures/topics.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 5b1c6b8..821b458 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -110,6 +110,12 @@ class RelationTest < ActiveRecord::TestCase assert_equal topics(:first).title, topics.first.title end + def test_finding_with_order_concatenated + topics = Topic.order('author_name').order('title') + assert_equal 4, topics.to_a.size + assert_equal topics(:fourth).title, topics.first.title + end + def test_finding_with_order_and_take entrants = Entrant.order("id ASC").limit(2).to_a diff --git a/activerecord/test/fixtures/topics.yml b/activerecord/test/fixtures/topics.yml index 1769152..93f48ae 100644 --- a/activerecord/test/fixtures/topics.yml +++ b/activerecord/test/fixtures/topics.yml @@ -24,7 +24,7 @@ second: third: id: 3 title: The Third Topic of the day - author_name: Nick + author_name: Carl written_on: 2005-07-15t15:28:00.0099+01:00 content: I'm a troll approved: true -- 1.7.1