These tasks dealt with data migrations or stats generations which were done only once, so we don't need them anymore. New CONSUL installations don't need these tasks, and existing CONSUL installations will execute them when upgrading one release at a time.
42 lines
1.6 KiB
Ruby
42 lines
1.6 KiB
Ruby
namespace :settings do
|
|
|
|
desc "Remove deprecated settings"
|
|
task remove_deprecated_settings: :environment do
|
|
deprecated_keys = [
|
|
"place_name",
|
|
"banner-style.banner-style-one",
|
|
"banner-style.banner-style-two",
|
|
"banner-style.banner-style-three",
|
|
"banner-img.banner-img-one",
|
|
"banner-img.banner-img-two",
|
|
"banner-img.banner-img-three",
|
|
"verification_offices_url"
|
|
]
|
|
|
|
deprecated_keys.each do |key|
|
|
Setting.where(key: key).first&.destroy
|
|
end
|
|
end
|
|
|
|
desc "Rename existing settings"
|
|
task rename_setting_keys: :environment do
|
|
Setting.rename_key from: "map_latitude", to: "map.latitude"
|
|
Setting.rename_key from: "map_longitude", to: "map.longitude"
|
|
Setting.rename_key from: "map_zoom", to: "map.zoom"
|
|
|
|
Setting.rename_key from: "feature.debates", to: "process.debates"
|
|
Setting.rename_key from: "feature.proposals", to: "process.proposals"
|
|
Setting.rename_key from: "feature.polls", to: "process.polls"
|
|
Setting.rename_key from: "feature.budgets", to: "process.budgets"
|
|
Setting.rename_key from: "feature.legislation", to: "process.legislation"
|
|
|
|
Setting.rename_key from: "per_page_code_head", to: "html.per_page_code_head"
|
|
Setting.rename_key from: "per_page_code_body", to: "html.per_page_code_body"
|
|
|
|
Setting.rename_key from: "feature.homepage.widgets.feeds.proposals", to: "homepage.widgets.feeds.proposals"
|
|
Setting.rename_key from: "feature.homepage.widgets.feeds.debates", to: "homepage.widgets.feeds.debates"
|
|
Setting.rename_key from: "feature.homepage.widgets.feeds.processes", to: "homepage.widgets.feeds.processes"
|
|
end
|
|
|
|
end
|