Skip to content

Commit 4cf1084

Browse files
authored
Remove ActiveRecord::Relation#calculate patch (#1200)
1 parent 6a4ac60 commit 4cf1084

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
ruby:
17-
- 2.7.7
1817
- 3.1.3
1918
- 3.2.1
2019

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Unreleased
2+
3+
#### Changed
4+
5+
- [#1200](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1200) Remove ActiveRecord::Relation#calculate patch
6+
17
## v7.0.6
28

39
#### Added

lib/active_record/connection_adapters/sqlserver/core_ext/calculations.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,6 @@ module ConnectionAdapters
88
module SQLServer
99
module CoreExt
1010
module Calculations
11-
# Same as original except we don't perform PostgreSQL hack that removes ordering.
12-
def calculate(operation, column_name)
13-
return super unless klass.connection.adapter_name == "SQLServer"
14-
15-
if has_include?(column_name)
16-
relation = apply_join_dependency
17-
18-
if operation.to_s.downcase == "count"
19-
unless distinct_value || distinct_select?(column_name || select_for_count)
20-
relation.distinct!
21-
relation.select_values = [klass.primary_key || table[Arel.star]]
22-
end
23-
end
24-
25-
relation.calculate(operation, column_name)
26-
else
27-
perform_calculation(operation, column_name)
28-
end
29-
end
3011

3112
private
3213

0 commit comments

Comments
 (0)