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 35c89a4 commit dd286a4c735dac1db8c9262581c7f29c44d1f695 @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
View
2 activerecord/lib/active_record/relation/finder_methods.rb
@@ -190,7 +190,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 dd286a4

Please sign in to comment.