aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/test/cases/relations_test.rb6
-rw-r--r--activerecord/test/fixtures/topics.yml2
2 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 5b1c6b8f22..821b4585a7 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 1769152445..93f48aedc4 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