Remove the #sum method from CollectionAssociation
Since edd94cee9af1688dd036fc58fd405adb30a5e0da, 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.
This commit is contained in:
parent
ad9983f625
commit
fd1c45761e
@ -161,15 +161,6 @@ def destroy_all
|
||||
end
|
||||
end
|
||||
|
||||
# Calculate sum using SQL, not Enumerable.
|
||||
def sum(*args)
|
||||
if block_given?
|
||||
scope.sum(*args) { |*block_args| yield(*block_args) }
|
||||
else
|
||||
scope.sum(*args)
|
||||
end
|
||||
end
|
||||
|
||||
# Count all records using SQL. If the +:counter_sql+ or +:finder_sql+ option is set for the
|
||||
# association, it will be used for the query. Otherwise, construct options and pass them with
|
||||
# scope to the target class's +count+.
|
||||
|
Loading…
Reference in New Issue
Block a user