handles_transitions.rb 461 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module ApplicationController::HandlesTransitions
  3. extend ActiveSupport::Concern
  4. included do
  5. around_action :handle_transaction
  6. end
  7. private
  8. def handle_transaction
  9. ApplicationHandleInfo.current = 'application_server'
  10. PushMessages.init
  11. yield
  12. TransactionDispatcher.commit
  13. PushMessages.finish
  14. ensure
  15. ApplicationHandleInfo.current = nil
  16. end
  17. end