From be4ecdcc87984e9421ff5d5c90d33f475e0fbc01 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(-) diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 5f6898b45a..824a88ffc4 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -176,7 +176,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