Created
June 26, 2012 21:26
-
-
Save tpope/2999229 to your computer and use it in GitHub Desktop.
Environment variable overrides in Rails
This file contains 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
# Add config/overrides/*.yml to .gitignore | |
# and this near the top of application.rb | |
%w(defaults overrides).each do |type| | |
path = File.expand_path("../#{type}/#{Rails.env}.yml", __FILE__) | |
ENV.update(YAML.load_file(path)) if File.exist?(path) | |
end | |
# For things that are sensitive or developer dependent: | |
# config/overrides/{development,test}.yml | |
# For everything else: | |
# config/defaults/{development,test}.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment