aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2010-11-07 09:54:43 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2010-11-07 09:55:17 -0200
commit6709078eb1f61a1f8d54fcd82e9a07e96383ec8a (patch)
tree2767b7ab2a44ace8e11831a805096b2a28c554ae /activerecord/test
parent1acc086278c974d7a3cdb0459cd65f73641abe33 (diff)
downloadrails-6709078eb1f61a1f8d54fcd82e9a07e96383ec8a.tar.gz
rails-6709078eb1f61a1f8d54fcd82e9a07e96383ec8a.tar.bz2
rails-6709078eb1f61a1f8d54fcd82e9a07e96383ec8a.zip
use column names as order by complex function parameters, fix for postgresql adapter to correctly remove ASC/DESC
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/relations_test.rb14
1 files changed, 2 insertions, 12 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index fbc257195c..0fd2b99937 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -146,22 +146,12 @@ class RelationTest < ActiveRecord::TestCase
end
def test_finding_with_complex_order_and_limit
- if current_adapter?(:SQLite3Adapter)
- tags = Tag.includes(:taggings).order("MIN(1,2)").limit(1).to_a
- else
- tags = Tag.includes(:taggings).order("LEAST(1,COS(1)*COS(-1)*COS(RADIANS(taggings.super_tag_id)))").limit(1).to_a
- end
-
+ tags = Tag.includes(:taggings).order("REPLACE('abc', taggings.taggable_type, taggings.taggable_type)").limit(1).to_a
assert_equal 1, tags.length
end
def test_finding_with_complex_order
- if current_adapter?(:SQLite3Adapter)
- tags = Tag.includes(:taggings).order("MIN(1,2)").to_a
- else
- tags = Tag.includes(:taggings).order("LEAST(1,COS(1)*COS(-1)*COS(RADIANS(taggings.super_tag_id)))").to_a
- end
-
+ tags = Tag.includes(:taggings).order("REPLACE('abc', taggings.taggable_type, taggings.taggable_type)").to_a
assert_equal 2, tags.length
end