[openstreetmap/openstreetmap-website] Use Config gem to read and validate configuration settings (#2170)
Andy Allan
notifications at github.com
Thu Mar 7 09:17:34 UTC 2019
> Having done some testing I think most of the above problems go away if we just bite the bullet and move our settings to `settings.yml` with per-environment overrides as necessary.
I was mulling this over last night, before I read your message, and I came to a similar conclusion. I realised that it's the only sensible approach to using settings in other initializers, which is exactly why the gem loads values so early. With this PR's approach of loading settings in a regular initializer, it would be hard to get it working at all.
> The only problem (given that the `config.rb` initialise is deliberately loaded very early) is the very first use of `STATUS` in `config/application.rb` which occurs before it is loaded. Maybe we should just say that status is always set from the environment and not use settings for it?
If that's workable with you, then great. I had a brief look around to see if there's anyone else with a "database offline" mode in rails, and how they manage it, but my googling was just picking up unrelated scenarios.
> So yes we can likely get rid of it.
Great. I'd like to support environment variables since it's useful when e.g. deploying to Heroku, but it's much easier if we can break compatibility with the existing ones if they are unused. I had no idea that we supported them either, until yesterday.
I'll close this PR, and work on the "bite the bullet" approach as a replacement.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2170#issuecomment-470447330
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190307/88a7c547/attachment.html>
More information about the rails-dev
mailing list