2013-06-12 15:59:58 +00:00
|
|
|
# Copyright (C) 2012-2013 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2013-04-30 12:13:53 +00:00
|
|
|
require 'cache'
|
|
|
|
|
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' )
|
|
|
|
Ticket.escalation_calculation_rebuild
|
|
|
|
end
|
|
|
|
end
|