From 6709078eb1f61a1f8d54fcd82e9a07e96383ec8a Mon Sep 17 00:00:00 2001 From: Raimonds Simanovskis Date: Sun, 7 Nov 2010 09:54:43 -0200 Subject: use column names as order by complex function parameters, fix for postgresql adapter to correctly remove ASC/DESC Signed-off-by: Santiago Pastorino --- activerecord/test/cases/relations_test.rb | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'activerecord/test/cases') 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 -- cgit v1.2.3