diff options
author | iaddict <ts@image-addicts.de> | 2011-05-19 02:00:08 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-10 16:26:40 -0300 |
commit | be4ecdcc87984e9421ff5d5c90d33f475e0fbc01 (patch) | |
tree | ceb84ee10b116401668bbda75e884e3e3a7493ff /activerecord/lib | |
parent | 4da1af7fc15c6508d327d205e3de3f8ef248da8f (diff) | |
download | rails-be4ecdcc87984e9421ff5d5c90d33f475e0fbc01.tar.gz rails-be4ecdcc87984e9421ff5d5c90d33f475e0fbc01.tar.bz2 rails-be4ecdcc87984e9421ff5d5c90d33f475e0fbc01.zip |
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
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |