diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-14 20:42:52 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-01-14 20:42:52 -0800 |
commit | fce3afa9b264126080489d8c3069b2df71de2769 (patch) | |
tree | efd81f0e921ad669e549286035aa6e6056086785 /activesupport | |
parent | 78ef738313d66226854b688db6ab256d078b40bb (diff) | |
parent | d696f8de92ceb3cb38b11ec3b200b082b9578742 (diff) | |
download | rails-fce3afa9b264126080489d8c3069b2df71de2769.tar.gz rails-fce3afa9b264126080489d8c3069b2df71de2769.tar.bz2 rails-fce3afa9b264126080489d8c3069b2df71de2769.zip |
Merge pull request #4471 from semaperepelitsa/enum_sum
Pass a symbol instead of a block in Enumerable#sum
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/enumerable.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/enumerable.rb b/activesupport/lib/active_support/core_ext/enumerable.rb index 9343bb7106..ae8de945d0 100644 --- a/activesupport/lib/active_support/core_ext/enumerable.rb +++ b/activesupport/lib/active_support/core_ext/enumerable.rb @@ -59,7 +59,7 @@ module Enumerable if block_given? map(&block).sum(identity) else - inject { |sum, element| sum + element } || identity + inject(:+) || identity end end |