1
0
Fork 0
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:
George Claghorn 2018-10-03 16:04:33 -04:00
parent 2031d5310a
commit a91dc46b32
2 changed files with 5 additions and 2 deletions

View file

@ -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

View file

@ -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