Skip to content

Commit 5694f2a

Browse files
committed
Remove ActiveRecord::Relation#calculate patch
1 parent 6a4ac60 commit 5694f2a

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

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+
- []() 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)