From 828fc82c9725cd9eae4e343db9201281b884191b Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Fri, 5 Oct 2018 23:06:19 +0100 Subject: [PATCH] Use _config.rb file for env vars --- models.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/models.rb b/models.rb index 43d4f58..be717b4 100644 --- a/models.rb +++ b/models.rb @@ -1,4 +1,5 @@ require 'data_mapper' +load '_config.rb' class Poll include DataMapper::Resource @@ -269,5 +270,5 @@ class Party has n, :campaigns end -DataMapper.setup(:default, ENV['DATABASE_URL'] || "postgres://postgres@localhost:5432/suttonelections") +DataMapper.setup(:default, ENV['DATABASE_URL']) DataMapper.auto_upgrade!