Skip to content

Instantly share code, notes, and snippets.

@harlow
Forked from dhh/config_for.rb
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harlow/93a06a5d321546da3a6a to your computer and use it in GitHub Desktop.
Save harlow/93a06a5d321546da3a6a to your computer and use it in GitHub Desktop.
module YourApp
class Application < Rails::Application
# Convenience for loading config/foo.yml for the current Rails env.
#
# Example:
#
# config/cleversafe.yml:
#
# production:
# url: http://127.0.0.1:8080
# namespace: bc3_production
# development:
# url: http://bc3.dev/cleversafe
# namespace: bc3_development
#
# Cleversafe.config = Application.config_for :cleversafe
def config_for(name, env = Rails.env)
YAML.load_file(Rails.root.join("config/#{name}.yml"))[env]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment