mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
attributes should be associated with tables
This commit is contained in:
@@ -211,7 +211,7 @@ module ActiveRecord
|
||||
select_statement = if operation == 'count' && column_name == :all
|
||||
"COUNT(*) AS count_all"
|
||||
else
|
||||
Arel::Attribute.new(@klass.unscoped, column_name).send(operation).as(aggregate_alias).to_sql
|
||||
Arel::Attribute.new(@klass.unscoped.table, column_name).send(operation).as(aggregate_alias).to_sql
|
||||
end
|
||||
|
||||
select_statement << ", #{group_field} AS #{group_alias}"
|
||||
|
||||
Reference in New Issue
Block a user