trabajo-afectivo/db/migrate/20210816125040_rename_notification_sender.rb
2021-08-17 14:10:02 +02:00

23 lines
729 B
Ruby

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
class RenameNotificationSender < ActiveRecord::Migration[6.0]
def change
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
setting = Setting.find_by(
name: 'notification_sender',
)
return if !setting
# rubocop:disable Lint/InterpolationCheck
setting.state_initial[:value] = '#{config.product_name} <noreply@#{config.fqdn}>'
if setting.state_current[:value].eql? 'Notification Master <noreply@#{config.fqdn}>'
setting.state_current[:value] = '#{config.product_name} <noreply@#{config.fqdn}>'
end
# rubocop:enable Lint/InterpolationCheck
setting.save!
end
end