diff options
author | Max Schwenk <maschwenk@gmail.com> | 2018-02-25 19:54:20 -0800 |
---|---|---|
committer | Max Schwenk <maschwenk@gmail.com> | 2018-02-25 19:54:20 -0800 |
commit | 5120bc90c236d5afed614a80de3431fdd14768dc (patch) | |
tree | b9becc64f682465b8367ab6559110780d9c0d709 /activerecord/lib/active_record/relation/calculations.rb | |
parent | 065c1fae12ddfa2b3744d0e872f6b6c10912f2eb (diff) | |
download | rails-5120bc90c236d5afed614a80de3431fdd14768dc.tar.gz rails-5120bc90c236d5afed614a80de3431fdd14768dc.tar.bz2 rails-5120bc90c236d5afed614a80de3431fdd14768dc.zip |
Distinct with order #count regression
Diffstat (limited to 'activerecord/lib/active_record/relation/calculations.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index 6a63eb70b1..f215c95f51 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -132,7 +132,7 @@ module ActiveRecord if has_include?(column_name) relation = apply_join_dependency - if operation.to_s.downcase == "count" && !distinct_value + if operation.to_s.downcase == "count" relation.distinct! # PostgreSQL: ORDER BY expressions must appear in SELECT list when using DISTINCT if (column_name == :all || column_name.nil?) && select_values.empty? |