trabajo-afectivo/app/controllers/application_controller/handles_transitions.rb

25 lines
511 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
module ApplicationController::HandlesTransitions
extend ActiveSupport::Concern
included do
around_action :handle_transaction
end
private
def handle_transaction
ApplicationHandleInfo.current = 'application_server'
PushMessages.init
yield
TransactionDispatcher.commit
PushMessages.finish
ActiveSupport::Dependencies::Reference.clear!
ensure
ApplicationHandleInfo.current = nil
end
end