From 0438abf139b61e549abfb01da8168e494f5aff09 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 17 Feb 2014 10:44:22 +1100 Subject: [PATCH] BUGFIX: Use ENV["USER"] before falling back to postgres --- lib/export/exporter.rb | 2 +- lib/import/importer.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/export/exporter.rb b/lib/export/exporter.rb index e56d93564e1..8cf0e92e318 100644 --- a/lib/export/exporter.rb +++ b/lib/export/exporter.rb @@ -155,7 +155,7 @@ module Export db_conf = Rails.configuration.database_configuration[Rails.env] host = db_conf["host"] password = db_conf["password"] - username = db_conf["username"] || "postgres" + username = db_conf["username"] || ENV["USER"] || "postgres" database = db_conf["database"] password_argument = "PGPASSWORD=#{password}" if password.present? diff --git a/lib/import/importer.rb b/lib/import/importer.rb index 7e78d23eb08..34fc5ecee28 100644 --- a/lib/import/importer.rb +++ b/lib/import/importer.rb @@ -203,7 +203,7 @@ module Import db_conf = Rails.configuration.database_configuration[Rails.env] host = db_conf["host"] password = db_conf["password"] - username = db_conf["username"] || "postgres" + username = db_conf["username"] || ENV["USER"] || "postgres" database = db_conf["database"] password_argument = "PGPASSWORD=#{password}" if password.present?