trabajo-afectivo/db/migrate/20170529000002_setting_delivery_permanent_failed.rb

36 lines
1.3 KiB
Ruby
Raw Normal View History

class SettingDeliveryPermanentFailed < ActiveRecord::Migration
def up
# return if it's a new setup
return if !Setting.find_by(name: 'system_init_done')
setting = Setting.find_by(name: '0900_postmaster_filter_bounce_check')
if setting
setting.name = '0900_postmaster_filter_bounce_follow_up_check'
setting.state = 'Channel::Filter::BounceFollowUpCheck'
setting.save!
else
Setting.create_if_not_exists(
title: 'Defines postmaster filter.',
name: '0900_postmaster_filter_bounce_follow_up_check',
area: 'Postmaster::PreFilter',
description: 'Defines postmaster filter to identify postmaster bounced - to handle it as follow-up of the original ticket.',
options: {},
state: 'Channel::Filter::BounceFollowUpCheck',
frontend: false
)
end
Setting.create_if_not_exists(
title: 'Defines postmaster filter.',
name: '0950_postmaster_filter_bounce_delivery_permanent_failed',
area: 'Postmaster::PreFilter',
description: 'Defines postmaster filter to identify postmaster bounced - disable sending notification on permanent deleivery failed.',
options: {},
state: 'Channel::Filter::BounceDeliveryPermanentFailed',
frontend: false
)
end
end