Skip to content
Browse files

Prefer Array.wrap to Array()

  • Loading branch information...
1 parent f07bcf0 commit 18d497651628c73287f3e808c3807121ad36e278 @jeremy jeremy committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 activesupport/lib/active_support/rescuable.rb
View
3 activesupport/lib/active_support/rescuable.rb
@@ -1,3 +1,4 @@
+require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/class/inheritable_attributes'
require 'active_support/core_ext/proc'
@@ -81,7 +82,7 @@ def rescue_with_handler(exception)
def handler_for_rescue(exception)
# We go from right to left because pairs are pushed onto rescue_handlers
# as rescue_from declarations are found.
- _, rescuer = Array(rescue_handlers).reverse.detect do |klass_name, handler|
+ _, rescuer = Array.wrap(rescue_handlers).reverse.detect do |klass_name, handler|
# The purpose of allowing strings in rescue_from is to support the
# declaration of handler associations for exception classes whose
# definition is yet unknown.

0 comments on commit 18d4976

Please sign in to comment.
Something went wrong with that request. Please try again.