mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Extend Callbacks and Rescuable with AS concern
This commit is contained in:
parent
9cd50e7752
commit
7b169ed1bb
2 changed files with 5 additions and 7 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue