diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-04 17:14:22 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-05-05 15:39:42 +0900 |
commit | 626f3d608868afed3aa725e3b6e0a5ce82b5e968 (patch) | |
tree | 21360824769f3900939840cb24dc6a48420b9226 /activerecord/lib/active_record/relation | |
parent | 7986555bf9cea7b4d8c55eeda22361495567486d (diff) | |
download | rails-626f3d608868afed3aa725e3b6e0a5ce82b5e968.tar.gz rails-626f3d608868afed3aa725e3b6e0a5ce82b5e968.tar.bz2 rails-626f3d608868afed3aa725e3b6e0a5ce82b5e968.zip |
Don't pass `arel.engine` to `Arel::SelectManager.new`
The argument of `Arel::SelectManager.new` is `table`, not `engine`.
https://github.com/rails/arel/blob/v8.0.0/lib/arel/select_manager.rb#L10
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index 9cabd1af13..861b2125d4 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -368,9 +368,8 @@ module ActiveRecord relation.select_values = [aliased_column] subquery = relation.arel.as(subquery_alias) - sm = Arel::SelectManager.new relation.engine select_value = operation_over_aggregate_column(column_alias, "count", distinct) - sm.project(select_value).from(subquery) + Arel::SelectManager.new(subquery).project(select_value) end end end |