mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Skip after callbacks on terminate
This commit is contained in:
parent
2031d5310a
commit
a91dc46b32
2 changed files with 5 additions and 2 deletions
|
@ -17,7 +17,7 @@ module ActionMailbox
|
|||
end
|
||||
|
||||
included do
|
||||
define_callbacks :process, terminator: TERMINATOR
|
||||
define_callbacks :process, terminator: TERMINATOR, skip_after_callbacks_if_terminated: true
|
||||
end
|
||||
|
||||
module ClassMethods
|
||||
|
|
|
@ -20,8 +20,10 @@ class BouncingCallbackMailbox < ActionMailbox::Base
|
|||
|
||||
before_processing { $before_processing << "Post-bounce" }
|
||||
|
||||
after_processing { $after_processing = true }
|
||||
|
||||
def process
|
||||
$processed = mail.subject
|
||||
$processed = true
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -43,5 +45,6 @@ class ActionMailbox::Base::CallbacksTest < ActiveSupport::TestCase
|
|||
assert @inbound_email.bounced?
|
||||
assert_equal [ "Pre-bounce", "Bounce" ], $before_processing
|
||||
assert_not $processed
|
||||
assert_not $after_processing
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue