I use the settingslogic plugin for such things. Very easy to use.
Add logic settings to your Gemfile and bundle install :
gem 'settingslogic'
Create a directory for your settings and place your log there:
/my_app/config/settings/my_settings.yml
You can enable default settings and environment settings. The file is as follows:
defaults: &defaults api_key: abc123 development: <<: *defaults test: <<: *defaults production: <<: *defaults
Add this file: app/models/my_settings.rb , run your application, and you're good to go
class MySettings < Settingslogic source "
Now you can use these settings from anywhere in the application, for example:
MySettings.api_key
johnmcaliley
source share