From e32e3af10d4b267a56e8cbf980d802552bf57e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 14 Oct 2019 15:11:08 +0200 Subject: [PATCH] Allow configuring test DB connection --- spec/support/schema.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec/support/schema.rb b/spec/support/schema.rb index 74d83bc..ca0277c 100644 --- a/spec/support/schema.rb +++ b/spec/support/schema.rb @@ -13,7 +13,9 @@ when 'pg', 'postgres', 'postgresql' ActiveRecord::Base.establish_connection( adapter: 'postgresql', database: 'ransack', - # username: 'postgres', # Uncomment the username option if you have set one + username: ENV.fetch("DATABASE_USERNAME") { "postgres" }, + password: ENV.fetch("DATABASE_PASSWORD") { "" }, + host: ENV.fetch("DATABASE_HOST") { "localhost" }, min_messages: 'warning' ) else