We need to add :rename_setting_keys before :add_new_settings task. This way the value of the old key will not be lost.
14 lines
420 B
Ruby
14 lines
420 B
Ruby
namespace :settings do
|
|
desc "Add new settings"
|
|
task add_new_settings: :environment do
|
|
ApplicationLogger.new.info "Adding new settings"
|
|
Setting.add_new_settings
|
|
end
|
|
|
|
desc "Rename existing settings"
|
|
task rename_setting_keys: :environment do
|
|
ApplicationLogger.new.info "Renaming existing settings"
|
|
Setting.rename_key from: "dashboard.emails", to: "feature.dashboard.notification_emails"
|
|
end
|
|
end
|