trabajo-afectivo/db/migrate/20210428125300_issue_3523_new_operator.rb
2022-01-01 14:38:12 +01:00

15 lines
548 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class Issue3523NewOperator < ActiveRecord::Migration[5.2]
def change
return if !Setting.exists?(name: 'system_init_done')
overview = Overview.find_by(link: 'all_escalated')
return if !overview
return if overview.condition['ticket.escalation_at'].blank?
return if overview.condition['ticket.escalation_at'][:operator] != 'before (relative)'
overview.condition['ticket.escalation_at'][:operator] = 'till (relative)'
overview.save!
end
end