2014-02-03 19:23:00 +00:00
|
|
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
2013-06-12 15:59:58 +00:00
|
|
|
|
2013-02-01 08:53:14 +00:00
|
|
|
class Sla < ApplicationModel
|
|
|
|
store :condition
|
|
|
|
store :data
|
|
|
|
validates :name, :presence => true
|
2013-03-07 07:13:56 +00:00
|
|
|
|
2013-03-07 10:34:42 +00:00
|
|
|
after_create :escalation_calculation_rebuild
|
|
|
|
after_update :escalation_calculation_rebuild
|
|
|
|
after_destroy :escalation_calculation_rebuild
|
2013-03-07 07:13:56 +00:00
|
|
|
|
|
|
|
private
|
2013-06-12 15:59:58 +00:00
|
|
|
def escalation_calculation_rebuild
|
|
|
|
Cache.delete( 'SLA::List::Active' )
|
2013-08-16 18:35:49 +00:00
|
|
|
Ticket::Escalation.rebuild_all
|
2013-06-12 15:59:58 +00:00
|
|
|
end
|
|
|
|
end
|