diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2017-02-26 14:04:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-26 14:04:18 +0000 |
commit | 39449ef980af1547510fbf43c8e3e4b92f815b48 (patch) | |
tree | 70d2b06fd518fdcb1ca268035e43c4e26c4217bc /activerecord/lib | |
parent | 0dfef8becfe32178d4fda2d068e2f9bfee8a7c40 (diff) | |
parent | 18125683ac2a23971b64a79d256ba6e252304c6f (diff) | |
download | rails-39449ef980af1547510fbf43c8e3e4b92f815b48.tar.gz rails-39449ef980af1547510fbf43c8e3e4b92f815b48.tar.bz2 rails-39449ef980af1547510fbf43c8e3e4b92f815b48.zip |
Merge pull request #28183 from eugeneius/having_select_column
Include selects in group query with having clause
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index 973678704f..f4cdaf3948 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -282,6 +282,7 @@ module ActiveRecord operation, distinct).as(aggregate_alias) ] + select_values += self.select_values unless having_clause.empty? select_values.concat group_columns.map { |aliaz, field| if field.respond_to?(:as) |