Merge pull request #194 from coopdevs/fix/database-yml

Rails complains when the `database.url` key is not an url
This commit is contained in:
Saverio Trioni
2016-03-24 12:24:01 +01:00
+17 -4
View File
@@ -1,8 +1,20 @@
# If you want to change this file, please keep the changes in your working
# copy by using
#
# git update-index --skip-worktree config/database.yml
#
# or just use DATABASE_URL, in which case Rails will happily skip the whole
# file.
#
# See https://github.com/coopdevs/timeoverflow/wiki/Keeping-your-local-files
# for more information
#
defaults: &defaults
adapter: postgresql
host: <%= ENV.fetch('DATABASE_HOST', 'localhost') %>
username: <%= ENV.fetch('DATABASE_USER', 'null') %>
password: <%= ENV.fetch('DATABASE_PASSWORD', 'null') %>
host: <%= ENV['DATABASE_HOST'] %> # default is localhost
username: <%= ENV['DATABASE_USER'] %> # default is null
password: <%= ENV['DATABASE_PASSWORD'] %> # default is null
encoding: utf8
development:
@@ -14,4 +26,5 @@ test:
database: <%= ENV.fetch('DATABASE_NAME', 'timeoverflow_test') %>
production:
url: <%= ENV.fetch('DATABASE_URL', 'Set DATABASE_URL environment variable') %>
# Set DATABASE_URL environment variable
url: <%= ENV['DATABASE_URL'] %>