Merge pull request #13578 from schneems/schneems/database_url-env-default

Use DATABASE_URL by default
This commit is contained in:
Rafael Mendonça França 2014-01-02 13:02:28 -08:00
commit 5aa869861c
12 changed files with 12 additions and 19 deletions

@ -26,4 +26,4 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -64,4 +64,4 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -56,4 +56,4 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -28,4 +28,4 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
production: <%%= ENV["RAILS_DATABASE_URL"] %>
production: <%%= ENV["DATABASE_URL"] %>

@ -45,4 +45,4 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -21,4 +21,4 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -39,4 +39,4 @@ test:
# mysql2://myuser:mypass@localhost/somedatabase
#
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -35,4 +35,4 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -66,4 +66,4 @@ test:
# postgres://myuser:mypass@localhost/somedatabase
#
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -27,4 +27,4 @@ test:
# sqlite3://myuser:mypass@localhost/full/path/to/somedatabase
#
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -45,4 +45,4 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
production:
url: <%%= ENV["RAILS_DATABASE_URL"] %>
url: <%%= ENV["DATABASE_URL"] %>

@ -21,16 +21,9 @@ def database_url_db_name
end
def set_database_url
ENV['RAILS_DATABASE_URL'] = File.join("sqlite3://:@localhost", database_url_db_name)
ENV['DATABASE_URL'] = File.join("sqlite3://:@localhost", database_url_db_name)
# ensure it's using the DATABASE_URL
FileUtils.rm_rf("#{app_path}/config/database.yml")
File.open("#{app_path}/config/database.yml", 'w') do |f|
yaml = <<-YAML.strip_heredoc
#{ENV['RAILS_ENV']}:
url: <%= ENV['RAILS_DATABASE_URL'] %>
YAML
f << yaml
end
end
def expected