BUGFIX: Use ENV["USER"] before falling back to postgres

This commit is contained in:
Sam 2014-02-17 10:44:22 +11:00
parent 73aca9063d
commit 0438abf139
2 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ module Export
db_conf = Rails.configuration.database_configuration[Rails.env] db_conf = Rails.configuration.database_configuration[Rails.env]
host = db_conf["host"] host = db_conf["host"]
password = db_conf["password"] password = db_conf["password"]
username = db_conf["username"] || "postgres" username = db_conf["username"] || ENV["USER"] || "postgres"
database = db_conf["database"] database = db_conf["database"]
password_argument = "PGPASSWORD=#{password}" if password.present? password_argument = "PGPASSWORD=#{password}" if password.present?

View File

@ -203,7 +203,7 @@ module Import
db_conf = Rails.configuration.database_configuration[Rails.env] db_conf = Rails.configuration.database_configuration[Rails.env]
host = db_conf["host"] host = db_conf["host"]
password = db_conf["password"] password = db_conf["password"]
username = db_conf["username"] || "postgres" username = db_conf["username"] || ENV["USER"] || "postgres"
database = db_conf["database"] database = db_conf["database"]
password_argument = "PGPASSWORD=#{password}" if password.present? password_argument = "PGPASSWORD=#{password}" if password.present?