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.
  • Loading branch information...
1 parent a921cab commit 0eae3923fc3b1fbebae7cb9102fd905a1fc6d7db @iaddict committed May 19, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/finder_methods.rb
@@ -185,7 +185,7 @@ def exists?(id = nil)
join_dependency = construct_join_dependency_for_association_find
relation = construct_relation_for_association_find(join_dependency)
- relation = relation.except(:select).select("1").limit(1)
+ relation = relation.except(:select).select("1 AS _one").limit(1)
case id
when Array, Hash

0 comments on commit 0eae392

Please sign in to comment.