Files
grecia/db/dev_seeds/settings.rb
Javi Martín f871658510 Use default_url_options to generate absolute URLs
In the dev seeds, we were using `Setting["url"]/proposals`, but we can
use `proposals_url` instead, similar to what we do in the rest of the
application.

We can do a similar thing in the sitemap. This way the sitemap will also
work on installations who haven't manually set the "url" setting.

Since we aren't using `Setting["url"]` anywhere anymore, we're removing
it.

This setting was mainly redundant, since we already had the
`server_name` in the secrets. Furthermore, `server_name` is
automatically configured when running the installer, while
`Setting["url"]` had to be manually set in the admin section the
application was installed.

Note we're using `ActionMailer::Base` setting to generate URLs. Sounds a
bit strange, but it's a standard way Rails provides to generate URLs
outside the context of a request.
2022-10-02 16:54:06 +02:00

27 lines
864 B
Ruby

section "Creating Settings" do
Setting.reset_defaults
{
"facebook_handle": "CONSUL",
"feature.featured_proposals": "true",
"feature.map": "true",
"instagram_handle": "CONSUL",
"mailer_from_address": "noreply@consul.dev",
"mailer_from_name": "CONSUL",
"meta_description": "Citizen participation tool for an open, "\
"transparent and democratic government",
"meta_keywords": "citizen participation, open government",
"meta_title": "CONSUL",
"org_name": "CONSUL",
"proposal_code_prefix": "MAD",
"proposal_notification_minimum_interval_in_days": 0,
"telegram_handle": "CONSUL",
"twitter_handle": "@consul_dev",
"twitter_hashtag": "#consul_dev",
"votes_for_proposal_success": "100",
"youtube_handle": "CONSUL"
}.each do |name, value|
Setting[name] = value
end
end