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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ec49b6e..189d24320 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Unreleased + +#### Changed + +- [#1200](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1200) 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