From 7b169ed1bb424929e332e998a75cdb4635c26f62 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 13 Oct 2009 23:30:06 -0500 Subject: [PATCH] Extend Callbacks and Rescuable with AS concern --- activesupport/lib/active_support/callbacks.rb | 4 +--- activesupport/lib/active_support/rescuable.rb | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 21388d7a58..67e9b0103f 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -81,9 +81,7 @@ module ActiveSupport # saved # module Callbacks - def self.included(klass) - klass.extend ClassMethods - end + extend Concern def run_callbacks(kind, *args, &block) send("_run_#{kind}_callbacks", *args, &block) diff --git a/activesupport/lib/active_support/rescuable.rb b/activesupport/lib/active_support/rescuable.rb index a7258c870a..879662c16c 100644 --- a/activesupport/lib/active_support/rescuable.rb +++ b/activesupport/lib/active_support/rescuable.rb @@ -4,11 +4,11 @@ require 'active_support/core_ext/proc' module ActiveSupport # Rescuable module adds support for easier exception handling. module Rescuable - def self.included(base) # :nodoc: - base.class_inheritable_accessor :rescue_handlers - base.rescue_handlers = [] + extend Concern - base.extend(ClassMethods) + included do + class_inheritable_accessor :rescue_handlers + self.rescue_handlers = [] end module ClassMethods