diff options
author | kennyj <kennyj@gmail.com> | 2013-06-01 21:36:50 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2013-06-01 23:22:12 +0900 |
commit | 5d75579eec90e4fe0f3d33adbf5e7065a7cdcfa3 (patch) | |
tree | 5ad9bd8aaf6ce8f0a3f626bd18b6e1c1f82b9944 /activerecord/lib | |
parent | d8c6f52d3b5971ed7541d1f6d92cac9e8f61f18c (diff) | |
download | rails-5d75579eec90e4fe0f3d33adbf5e7065a7cdcfa3.tar.gz rails-5d75579eec90e4fe0f3d33adbf5e7065a7cdcfa3.tar.bz2 rails-5d75579eec90e4fe0f3d33adbf5e7065a7cdcfa3.zip |
Remove #sum with a block was deprecated.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/calculations.rb | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index 7239270c4d..e234e02032 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -56,15 +56,7 @@ module ActiveRecord # # Person.sum(:age) # => 4562 def sum(*args) - if block_given? - ActiveSupport::Deprecation.warn( - "Calling #sum with a block is deprecated and will be removed in Rails 4.1. " \ - "If you want to perform sum calculation over the array of elements, use `to_a.sum(&block)`." - ) - self.to_a.sum(*args) {|*block_args| yield(*block_args)} - else - calculate(:sum, *args) - end + calculate(:sum, *args) end # This calculates aggregate values in the given column. Methods for count, sum, average, |