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 17:00:55 -0300 |
commit | dd286a4c735dac1db8c9262581c7f29c44d1f695 (patch) | |
tree | ca767d7b0a5f6e02df2e6a8bae4155bf27337974 | |
parent | 35c89a48037391a10de0d12aa094c988a576d900 (diff) | |
download | rails-dd286a4c735dac1db8c9262581c7f29c44d1f695.tar.gz rails-dd286a4c735dac1db8c9262581c7f29c44d1f695.tar.bz2 rails-dd286a4c735dac1db8c9262581c7f29c44d1f695.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
-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 4737a194f0..fa457ae0c6 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -190,7 +190,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 |