diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-19 00:53:37 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-19 00:53:37 -0700 |
commit | 1f190c4873963598eea306a99b56c4a24cb817d0 (patch) | |
tree | 53572eea6855bbfcad528830b86c4f8f10ab0a50 /activesupport/lib | |
parent | 4d635bd6e86f2728419cfc4c56f9a4c6bde8aeae (diff) | |
download | rails-1f190c4873963598eea306a99b56c4a24cb817d0.tar.gz rails-1f190c4873963598eea306a99b56c4a24cb817d0.tar.bz2 rails-1f190c4873963598eea306a99b56c4a24cb817d0.zip |
Ruby 2.4 Array#sum: fix non-numeric #sum feature detection
Diffstat (limited to 'activesupport/lib')
-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 f297214d0f..0e03f7d7be 100644 --- a/activesupport/lib/active_support/core_ext/enumerable.rb +++ b/activesupport/lib/active_support/core_ext/enumerable.rb @@ -110,7 +110,7 @@ end # We tried shimming it to attempt the fast native method, rescue TypeError, # and fall back to the compatible implementation, but that's much slower than # just calling the compat method in the first place. -if Array.instance_methods(false).include?(:sum) && (%w[a].sum rescue true) +if Array.instance_methods(false).include?(:sum) && !(%w[a].sum rescue false) class Array def sum(*args) #:nodoc: # Use Enumerable#sum instead. |