sla.rb 478 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
  2. require 'cache'
  3. class Sla < ApplicationModel
  4. store :condition
  5. store :data
  6. validates :name, :presence => true
  7. after_create :escalation_calculation_rebuild
  8. after_update :escalation_calculation_rebuild
  9. after_destroy :escalation_calculation_rebuild
  10. private
  11. def escalation_calculation_rebuild
  12. Cache.delete( 'SLA::List::Active' )
  13. Ticket::Escalation.rebuild_all
  14. end
  15. end