Skip to content

Commit fd1c457

Browse files
Remove the #sum method from CollectionAssociation
Since edd94ce, CollectionProxy delegates all calculation methods - except count - to the scope, which does basically what this method was doing, but since we're delegating from the proxy, the association method was never called.
1 parent ad9983f commit fd1c457

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

activerecord/lib/active_record/associations/collection_association.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,6 @@ def destroy_all
161161
end
162162
end
163163

164-
# Calculate sum using SQL, not Enumerable.
165-
def sum(*args)
166-
if block_given?
167-
scope.sum(*args) { |*block_args| yield(*block_args) }
168-
else
169-
scope.sum(*args)
170-
end
171-
end
172-
173164
# Count all records using SQL. If the +:counter_sql+ or +:finder_sql+ option is set for the
174165
# association, it will be used for the query. Otherwise, construct options and pass them with
175166
# scope to the target class's +count+.

0 commit comments

Comments
 (0)