aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-11-12 16:50:55 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2009-11-13 09:52:53 -0800
commit18d497651628c73287f3e808c3807121ad36e278 (patch)
tree8da923cb4739e90420f00b5953863a16493e39f8 /activesupport
parentf07bcf015e35c400f12bf8274dc9cc4ec38be986 (diff)
downloadrails-18d497651628c73287f3e808c3807121ad36e278.tar.gz
rails-18d497651628c73287f3e808c3807121ad36e278.tar.bz2
rails-18d497651628c73287f3e808c3807121ad36e278.zip
Prefer Array.wrap to Array()
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/rescuable.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/rescuable.rb b/activesupport/lib/active_support/rescuable.rb
index 879662c16c..dd0752b09d 100644
--- a/activesupport/lib/active_support/rescuable.rb
+++ b/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 @@ module ActiveSupport
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.