Maintenance: ApplicationHandleInfo.current = 'application_server' leaks into following test on raised exceptions while processing Controller action.

This commit is contained in:
Thorsten Eckel 2021-01-12 15:03:51 +01:00
parent 375b6242ad
commit 3c4f46a886

View file

@ -2,20 +2,21 @@ module ApplicationController::HandlesTransitions
extend ActiveSupport::Concern
included do
before_action :transaction_begin
after_action :transaction_end
around_action :handle_transaction
end
private
def transaction_begin
def handle_transaction
ApplicationHandleInfo.current = 'application_server'
PushMessages.init
end
def transaction_end
yield
Observer::Transaction.commit
PushMessages.finish
ActiveSupport::Dependencies::Reference.clear!
ensure
ApplicationHandleInfo.current = nil
end
end