Skip to content
Browse files

Merge pull request #13578 from schneems/schneems/database_url-env-def…

…ault

Use DATABASE_URL by default
  • Loading branch information...
2 parents 96288e8 + f642b18 commit 5aa869861c192daceafe3a3ee50eb93f5a2b7bd2 @rafaelfranca rafaelfranca committed Jan 2, 2014
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml
@@ -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"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml
@@ -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"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml
@@ -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"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml
@@ -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"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml
@@ -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"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml
@@ -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"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml
@@ -39,4 +39,4 @@ test:
# mysql2://myuser:mypass@localhost/somedatabase
#
production:
- url: <%%= ENV["RAILS_DATABASE_URL"] %>
+ url: <%%= ENV["DATABASE_URL"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/oracle.yml
@@ -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"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml
@@ -66,4 +66,4 @@ test:
# postgres://myuser:mypass@localhost/somedatabase
#
production:
- url: <%%= ENV["RAILS_DATABASE_URL"] %>
+ url: <%%= ENV["DATABASE_URL"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml
@@ -27,4 +27,4 @@ test:
# sqlite3://myuser:mypass@localhost/full/path/to/somedatabase
#
production:
- url: <%%= ENV["RAILS_DATABASE_URL"] %>
+ url: <%%= ENV["DATABASE_URL"] %>
View
2 railties/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml
@@ -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"] %>
View
9 railties/test/application/rake/dbs_test.rb
@@ -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

0 comments on commit 5aa8698

Please sign in to comment.
Something went wrong with that request. Please try again.