diff options
| author | Santiago Pastorino <santiago@wyeworks.com> | 2010-06-25 19:22:45 -0300 |
|---|---|---|
| committer | José Valim <jose.valim@gmail.com> | 2010-06-26 00:59:11 +0200 |
| commit | a2513aea07255877b66b846fcf7ebb35629199df (patch) | |
| tree | 9f96752df3e5d5597bc4ad0c500ff38877d57eb8 | |
| parent | cae33c41589373d62c76e2bb3cdb3fa023ec8521 (diff) | |
| download | rails-a2513aea07255877b66b846fcf7ebb35629199df.tar.gz rails-a2513aea07255877b66b846fcf7ebb35629199df.tar.bz2 rails-a2513aea07255877b66b846fcf7ebb35629199df.zip | |
Test for concatenated orders added
[#4972]
Signed-off-by: José Valim <jose.valim@gmail.com>
| -rw-r--r-- | activerecord/test/cases/relations_test.rb | 6 | ||||
| -rw-r--r-- | 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 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 |
