handles_transitions.rb 435 B

123456789101112131415161718192021
  1. module ApplicationController::HandlesTransitions
  2. extend ActiveSupport::Concern
  3. included do
  4. before_action :transaction_begin
  5. after_action :transaction_end
  6. end
  7. private
  8. def transaction_begin
  9. ApplicationHandleInfo.current = 'application_server'
  10. PushMessages.init
  11. end
  12. def transaction_end
  13. Observer::Transaction.commit
  14. PushMessages.finish
  15. ActiveSupport::Dependencies::Reference.clear!
  16. end
  17. end