aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-19 09:01:20 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-21 22:21:04 -0200
commitfd1c45761e023cecdc9ad472df64f8c265e25aaf (patch)
treea73f4abd20a8a42064916670a0ea6fe401ccc7ad /activerecord/lib/active_record/associations
parentad9983f625ea414c5b7bbc0fd12be17ec04fc590 (diff)
downloadrails-fd1c45761e023cecdc9ad472df64f8c265e25aaf.tar.gz
rails-fd1c45761e023cecdc9ad472df64f8c265e25aaf.tar.bz2
rails-fd1c45761e023cecdc9ad472df64f8c265e25aaf.zip
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.
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/collection_association.rb9
1 files changed, 0 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb
index 862ff201de..1548e68cea 100644
--- a/activerecord/lib/active_record/associations/collection_association.rb
+++ b/activerecord/lib/active_record/associations/collection_association.rb
@@ -161,15 +161,6 @@ module ActiveRecord
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+.