aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/rescuable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/rescuable.rb')
-rw-r--r--activesupport/lib/active_support/rescuable.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/rescuable.rb b/activesupport/lib/active_support/rescuable.rb
index 6e660f8647..e4c1651acf 100644
--- a/activesupport/lib/active_support/rescuable.rb
+++ b/activesupport/lib/active_support/rescuable.rb
@@ -1,4 +1,4 @@
-require 'active_support/core_ext/class/inheritable_attributes'
+require 'active_support/core_ext/class/attribute'
require 'active_support/core_ext/proc'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/array/extract_options'
@@ -9,7 +9,7 @@ module ActiveSupport
extend Concern
included do
- class_inheritable_accessor :rescue_handlers
+ class_attribute :rescue_handlers
self.rescue_handlers = []
end
@@ -67,7 +67,7 @@ module ActiveSupport
end
# put the new handler at the end because the list is read in reverse
- rescue_handlers << [key, options[:with]]
+ self.rescue_handlers += [[key, options[:with]]]
end
end
end
@@ -83,7 +83,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 = rescue_handlers.reverse.detect do |klass_name, handler|
+ _, rescuer = self.class.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.