escalation_update.rb 439 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. class Observer::Ticket::EscalationUpdate < ActiveRecord::Observer
  3. observe 'ticket'
  4. def after_commit(record)
  5. _check(record)
  6. end
  7. private
  8. def _check(record)
  9. # return if we run import mode
  10. return true if Setting.get('import_mode')
  11. return true if !Ticket.exists?(record.id)
  12. record.reload
  13. record.escalation_calculation
  14. end
  15. end