From dd286a4c735dac1db8c9262581c7f29c44d1f695 Mon Sep 17 00:00:00 2001 From: iaddict Date: Thu, 19 May 2011 02:00:08 -0700 Subject: Minimal change to query generation of exists? that makes SQLServer and others happy that do not work without a column alias. Conflicts: activerecord/lib/active_record/relation/finder_methods.rb --- activerecord/lib/active_record/relation/finder_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 4737a194f0..fa457ae0c6 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -190,7 +190,7 @@ module ActiveRecord join_dependency = construct_join_dependency_for_association_find relation = construct_relation_for_association_find(join_dependency) - relation = relation.except(:select, :order).select("1").limit(1) + relation = relation.except(:select, :order).select("1 AS _one").limit(1) case id when Array, Hash -- cgit v1.2.3