1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Prefer Array.wrap to Array()

This commit is contained in:
Jeremy Kemper 2009-11-12 16:50:55 -08:00
parent f07bcf015e
commit 18d4976516

View file

@ -1,3 +1,4 @@
require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/class/inheritable_attributes' require 'active_support/core_ext/class/inheritable_attributes'
require 'active_support/core_ext/proc' require 'active_support/core_ext/proc'
@ -81,7 +82,7 @@ module ActiveSupport
def handler_for_rescue(exception) def handler_for_rescue(exception)
# We go from right to left because pairs are pushed onto rescue_handlers # We go from right to left because pairs are pushed onto rescue_handlers
# as rescue_from declarations are found. # 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 # The purpose of allowing strings in rescue_from is to support the
# declaration of handler associations for exception classes whose # declaration of handler associations for exception classes whose
# definition is yet unknown. # definition is yet unknown.