mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #30686 from metaskills/sqlserver-1as1fix
Ensure `1 AS one` for SQL Server with Calculations
This commit is contained in:
commit
c371eeffb3
1 changed files with 1 additions and 1 deletions
|
@ -391,7 +391,7 @@ module ActiveRecord
|
|||
def build_count_subquery(relation, column_name, distinct)
|
||||
relation.select_values = [
|
||||
if column_name == :all
|
||||
distinct ? table[Arel.star] : Arel.sql("1")
|
||||
distinct ? table[Arel.star] : Arel.sql(FinderMethods::ONE_AS_ONE)
|
||||
else
|
||||
column_alias = Arel.sql("count_column")
|
||||
aggregate_column(column_name).as(column_alias)
|
||||
|
|
Loading…
Reference in a new issue