Permalink
Browse files

Merge pull request #9358 from iwiznia/patch-1

Update railties/lib/rails/application/configuration.rb
  • Loading branch information...
2 parents ea544e9 + 7b6f2a0 commit c1b4b3b5fe2a41e426e78287686a1194da2d8343 @fxn fxn committed Feb 21, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 railties/lib/rails/application/configuration.rb
@@ -97,9 +97,9 @@ def threadsafe!
self
end
- # Loads and returns the contents of the #database_configuration_file. The
- # contents of the file are processed via ERB before being sent through
- # YAML::load.
+ # Loads and returns the configuration of the database.
+ # First, looks at If ENV['DATABASE_URL'] if it's not present it uses the #paths["config/database"]
+ # The contents of the file are processed via ERB before being sent through YAML::load.
def database_configuration
if ENV['DATABASE_URL']
{Rails.env => ActiveRecord::ConnectionAdapters::ConnectionSpecification::Resolver.connection_url_to_hash(ENV['DATABASE_URL']).stringify_keys}

0 comments on commit c1b4b3b

Please sign in to comment.