Simplify dev seed settings code

This commit is contained in:
Javi Martín
2018-12-07 12:18:04 +01:00
parent ced0409270
commit 3db1acf73d

View File

@@ -1,37 +1,32 @@
section "Creating Settings" do section "Creating Settings" do
Setting.reset_defaults Setting.reset_defaults
Setting.create(key: "official_level_1_name", {
value: I18n.t("seeds.settings.official_level_1_name")) "facebook_handle": "CONSUL",
Setting.create(key: "official_level_2_name", "feature.featured_proposals": "true",
value: I18n.t("seeds.settings.official_level_2_name")) "feature.map": "true",
Setting.create(key: "official_level_3_name", "instagram_handle": "CONSUL",
value: I18n.t("seeds.settings.official_level_3_name")) "mailer_from_address": "noreply@consul.dev",
Setting.create(key: "official_level_4_name", "mailer_from_name": "CONSUL",
value: I18n.t("seeds.settings.official_level_4_name")) "meta_description": "Citizen participation tool for an open, "\
Setting.create(key: "official_level_5_name", "transparent and democratic government",
value: I18n.t("seeds.settings.official_level_5_name")) "meta_keywords": "citizen participation, open government",
Setting.create(key: "proposal_code_prefix", value: "MAD") "meta_title": "CONSUL",
Setting.create(key: "votes_for_proposal_success", value: "100") "official_level_1_name": I18n.t("seeds.settings.official_level_1_name"),
"official_level_2_name": I18n.t("seeds.settings.official_level_2_name"),
Setting.create(key: "twitter_handle", value: "@consul_dev") "official_level_3_name": I18n.t("seeds.settings.official_level_3_name"),
Setting.create(key: "twitter_hashtag", value: "#consul_dev") "official_level_4_name": I18n.t("seeds.settings.official_level_4_name"),
Setting.create(key: "facebook_handle", value: "CONSUL") "official_level_5_name": I18n.t("seeds.settings.official_level_5_name"),
Setting.create(key: "youtube_handle", value: "CONSUL") "org_name": "CONSUL",
Setting.create(key: "telegram_handle", value: "CONSUL") "proposal_code_prefix": "MAD",
Setting.create(key: "instagram_handle", value: "CONSUL") "proposal_notification_minimum_interval_in_days": 0,
Setting.create(key: "url", value: "http://localhost:3000") "telegram_handle": "CONSUL",
Setting.create(key: "org_name", value: "CONSUL") "twitter_handle": "@consul_dev",
"twitter_hashtag": "#consul_dev",
Setting.create(key: "feature.featured_proposals", value: "true") "url": "http://localhost:3000",
"votes_for_proposal_success": "100",
Setting.create(key: "feature.map", value: "true") "youtube_handle": "CONSUL"
}.each do |name, value|
Setting.create(key: "mailer_from_name", value: "CONSUL") Setting[name] = value
Setting.create(key: "mailer_from_address", value: "noreply@consul.dev") end
Setting.create(key: "meta_title", value: "CONSUL")
Setting.create(key: "meta_description", value: "Citizen participation tool for an open, "\
"transparent and democratic government")
Setting.create(key: "meta_keywords", value: "citizen participation, open government")
Setting.create(key: "proposal_notification_minimum_interval_in_days", value: 0)
end end