diff --git a/app/models/calendar.rb b/app/models/calendar.rb index 54d25d36a..26f42ade0 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -210,7 +210,7 @@ returns # check if min one is set to default true def min_one_check Calendar.all.each {|calendar| - return if calendar.default + return true if calendar.default } first = Calendar.order(:created_at, :id).limit(1).first first.default = true diff --git a/app/models/ticket/escalation.rb b/app/models/ticket/escalation.rb index 42c9b8f3c..3fda59253 100644 --- a/app/models/ticket/escalation.rb +++ b/app/models/ticket/escalation.rb @@ -108,8 +108,8 @@ returns self.update_time_escal_date = biz.time(pending_time, :minutes).after(update_time_escal_date) end end - if (!self.escalation_time && self.update_time_escal_date) || self.update_time_escal_date < self.escalation_time - self.escalation_time = self.update_time_escal_date + if (!escalation_time && update_time_escal_date) || update_time_escal_date < escalation_time + self.escalation_time = update_time_escal_date end # get update time in min @@ -136,10 +136,8 @@ returns if close_time self.close_time_in_min = pending_minutes(created_at, close_time, biz, 'business_minutes') else - if (!self.escalation_time && self.close_time_escal_date) || self.close_time_escal_date < self.escalation_time - if !escalation_disabled - self.escalation_time = self.close_time_escal_date - end + if (!escalation_time && close_time_escal_date) || close_time_escal_date < escalation_time + self.escalation_time = close_time_escal_date end end diff --git a/db/migrate/20150969000001_update_sla.rb b/db/migrate/20150969000001_update_sla.rb index 4b2e6584c..c0f97fe13 100644 --- a/db/migrate/20150969000001_update_sla.rb +++ b/db/migrate/20150969000001_update_sla.rb @@ -5,4 +5,4 @@ class UpdateSla < ActiveRecord::Migration remove_column :slas, :data remove_column :slas, :active end -end \ No newline at end of file +end diff --git a/db/migrate/20150970000001_update_ticket_state.rb b/db/migrate/20150970000001_update_ticket_state.rb index d73e6483d..bb829e90f 100644 --- a/db/migrate/20150970000001_update_ticket_state.rb +++ b/db/migrate/20150970000001_update_ticket_state.rb @@ -10,4 +10,4 @@ class UpdateTicketState < ActiveRecord::Migration Ticket::State.create_or_update( id: 7, name: 'pending close', state_type_id: Ticket::StateType.find_by(name: 'pending action').id, next_state_id: 4, ignore_escalation: true ) end -end \ No newline at end of file +end