Maintenance: ApplicationHandleInfo.current = 'application_server'
leaks into following test on raised exceptions while processing Controller action.
This commit is contained in:
parent
375b6242ad
commit
3c4f46a886
1 changed files with 6 additions and 5 deletions
|
@ -2,20 +2,21 @@ module ApplicationController::HandlesTransitions
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
before_action :transaction_begin
|
around_action :handle_transaction
|
||||||
after_action :transaction_end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def transaction_begin
|
def handle_transaction
|
||||||
ApplicationHandleInfo.current = 'application_server'
|
ApplicationHandleInfo.current = 'application_server'
|
||||||
PushMessages.init
|
PushMessages.init
|
||||||
end
|
|
||||||
|
|
||||||
def transaction_end
|
yield
|
||||||
|
|
||||||
Observer::Transaction.commit
|
Observer::Transaction.commit
|
||||||
PushMessages.finish
|
PushMessages.finish
|
||||||
ActiveSupport::Dependencies::Reference.clear!
|
ActiveSupport::Dependencies::Reference.clear!
|
||||||
|
ensure
|
||||||
|
ApplicationHandleInfo.current = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue