Permalink
Browse files

Minimal change to query generation of exists? that makes SQLServer an…

…d others happy that do not work without a column alias.

Conflicts:
	activerecord/lib/active_record/relation/finder_methods.rb
  • Loading branch information...
1 parent 4da1af7 commit be4ecdcc87984e9421ff5d5c90d33f475e0fbc01 @iaddict iaddict committed with rafaelfranca May 19, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/finder_methods.rb
@@ -176,7 +176,7 @@ def exists?(id = false)
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

0 comments on commit be4ecdc

Please sign in to comment.