From 5694f2aeecf6013d9b57d0fd9dc12f2305cbe17c Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Thu, 4 Jul 2024 14:43:33 +0100 Subject: [PATCH 1/3] Remove ActiveRecord::Relation#calculate patch --- CHANGELOG.md | 6 ++++++ .../sqlserver/core_ext/calculations.rb | 19 ------------------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ec49b6e..dfaea6b6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Unreleased + +#### Changed + +- []() Remove ActiveRecord::Relation#calculate patch + ## v7.0.6 #### Added 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 da0e37f80..0346a090a 100644 --- a/lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb +++ b/lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb @@ -8,25 +8,6 @@ module ConnectionAdapters module SQLServer module CoreExt module Calculations - # Same as original except we don't perform PostgreSQL hack that removes ordering. - def calculate(operation, column_name) - return super unless klass.connection.adapter_name == "SQLServer" - - if has_include?(column_name) - relation = apply_join_dependency - - if operation.to_s.downcase == "count" - unless distinct_value || distinct_select?(column_name || select_for_count) - relation.distinct! - relation.select_values = [klass.primary_key || table[Arel.star]] - end - end - - relation.calculate(operation, column_name) - else - perform_calculation(operation, column_name) - end - end private From 05fad1242ec69ae2f52cd7c30f7e8e577f67b8d7 Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Thu, 4 Jul 2024 14:44:35 +0100 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfaea6b6e..189d24320 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ #### Changed -- []() Remove ActiveRecord::Relation#calculate patch +- [#1200](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1200) Remove ActiveRecord::Relation#calculate patch ## v7.0.6 From 4dcb00f00bfa8737df83f6ba193ed45731f39904 Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Thu, 4 Jul 2024 14:48:38 +0100 Subject: [PATCH 3/3] Removed no longer maintained Ruby version that is failing CI --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 687823942..3c48eb342 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,6 @@ jobs: fail-fast: false matrix: ruby: - - 2.7.7 - 3.1.3 - 3.2.1