Skip to content

Commit

Permalink
Minimal change to query generation of exists? that makes SQLServer an…
Browse files Browse the repository at this point in the history
…d others happy that do not work without a column alias.

Conflicts:
	activerecord/lib/active_record/relation/finder_methods.rb
  • Loading branch information
iaddict authored and rafaelfranca committed Jun 10, 2012
1 parent 35c89a4 commit dd286a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/finder_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd286a4

Please sign in to comment.