Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. config.before_configuration do
  2. ['env.local.yml', 'env.yml'].each do |file_variation|
  3. env_file = File.join(Rails.root, 'config', file_variation)
  4. YAML.load(File.open(env_file)).each do |key, value|
  5. ENV[key.to_s] = value unless ENV[key.to_s].present?
  6. end if File.exists?(env_file) && YAML.load(File.open(env_file))
  7. end
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement