aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2016-11-17 18:27:25 -0500
committerGitHub <noreply@github.com>2016-11-17 18:27:25 -0500
commitc659cb8561f03c2e0b29da0379a9c341400e03bd (patch)
treefc8ed92f3b556f00cbf98759c574922bba347dab /activerecord/lib/active_record
parent6e63b0aa137c8e231e77989a3c66ff9df6595602 (diff)
parent2bf7c30049558c2503f20e9810fdf4727650fe99 (diff)
downloadrails-c659cb8561f03c2e0b29da0379a9c341400e03bd.tar.gz
rails-c659cb8561f03c2e0b29da0379a9c341400e03bd.tar.bz2
rails-c659cb8561f03c2e0b29da0379a9c341400e03bd.zip
Merge pull request #26981 from kamipo/should_not_except_order_for_exists
Should except `:distinct` rather than `:order` for `exists?`
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb2
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 97a819c5af..55ded4c6d0 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -321,7 +321,7 @@ module ActiveRecord
relation = apply_join_dependency(self, construct_join_dependency(eager_loading: false))
return false if ActiveRecord::NullRelation === relation
- relation = relation.except(:select, :order).select(ONE_AS_ONE).limit(1)
+ relation = relation.except(:select, :distinct).select(ONE_AS_ONE).limit(1)
case conditions
when Array, Hash