2017-03-09 11:44:51 +00:00
|
|
|
module ApplicationController::HandlesTransitions
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
2021-01-12 14:03:51 +00:00
|
|
|
around_action :handle_transaction
|
2017-03-09 11:44:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2021-01-12 14:03:51 +00:00
|
|
|
def handle_transaction
|
2017-03-09 11:44:51 +00:00
|
|
|
ApplicationHandleInfo.current = 'application_server'
|
|
|
|
PushMessages.init
|
|
|
|
|
2021-01-12 14:03:51 +00:00
|
|
|
yield
|
|
|
|
|
2021-05-20 06:59:02 +00:00
|
|
|
TransactionDispatcher.commit
|
2017-03-09 11:44:51 +00:00
|
|
|
PushMessages.finish
|
|
|
|
ActiveSupport::Dependencies::Reference.clear!
|
2021-01-12 14:03:51 +00:00
|
|
|
ensure
|
|
|
|
ApplicationHandleInfo.current = nil
|
2017-03-09 11:44:51 +00:00
|
|
|
end
|
|
|
|
end
|