提交 fd1c4576 编写于 作者: C Carlos Antonio da Silva

Remove the #sum method from CollectionAssociation

Since edd94cee, 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.
上级 ad9983f6
......@@ -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+.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册