PostgreSQL: pg driver expects nil instead of empty string for missing user/pass

This commit is contained in:
Jeremy Kemper
2008-08-26 01:48:41 -07:00
parent d2d739fd06
commit b319e69ecb

View File

@@ -23,8 +23,8 @@ module ActiveRecord
config = config.symbolize_keys
host = config[:host]
port = config[:port] || 5432
username = config[:username].to_s
password = config[:password].to_s
username = config[:username].to_s if config[:username]
password = config[:password].to_s if config[:password]
if config.has_key?(:database)
database = config[:database]