settingslogic icon indicating copy to clipboard operation
settingslogic copied to clipboard

Ability to override settings with ENV variables

Open woahdae opened this issue 13 years ago • 1 comments

I implemented my own Settings without knowing about Settingslogic, and the api is almost exactly the same except that I have ENV-overrides built in for misc things like the google maps api keys, some external service creds, etc. With the popularity of heroku and pow, certain settings get messy unless your settings object has a concept of env variable overrides.

I'd love to switch the app to Settingslogic and contribute a patch with the ENV feature, but would it be accepted (assuming it wasn't a huge hack :)?

woahdae avatar Feb 15 '12 02:02 woahdae

This capability is built into settingslogic - just define something like this in your settings.yml:

api_key: <%= ENV['APPLICATION_API_KEY'] || 'defaultkey' %>

aripollak avatar Aug 12 '13 17:08 aripollak