Created
February 25, 2015 21:28
-
-
Save rafaelcgo/d0ec3395f4ff9fe75a1b to your computer and use it in GitHub Desktop.
Rails loading config from yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.before_configuration do | |
env_file = File.join(Rails.root, 'config', 'local_env.yml') | |
YAML.load(File.open(env_file)).each do |key, value| | |
ENV[key.to_s] = value | |
end if File.exists?(env_file) | |
end |
banduk
commented
Feb 25, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment