From cce2b03f7e4fc096af7870c5f7fa2fd812bbef46 Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Fri, 27 Sep 2024 19:12:42 +0100 Subject: [PATCH] Keep ordering if count subquery --- .../sqlserver/core_ext/calculations.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb b/lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb index 5fafea101..68cb3adf0 100644 --- a/lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb +++ b/lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb @@ -11,12 +11,12 @@ module Calculations private - def build_count_subquery(relation, column_name, distinct) - model.with_connection do |connection| - relation = relation.unscope(:order) if connection.sqlserver? - super(relation, column_name, distinct) - end - end + # def build_count_subquery(relation, column_name, distinct) + # model.with_connection do |connection| + # relation = relation.unscope(:order) if connection.sqlserver? + # super(relation, column_name, distinct) + # end + # end end end end