Permalink
Browse files

PostgreSQL: pg driver expects nil instead of empty string for missing…

… user/pass
  • Loading branch information...
1 parent d2d739f commit b319e69ecb06692995664dba263813d99bc2145f @jeremy jeremy committed Aug 26, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
View
4 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -23,8 +23,8 @@ def self.postgresql_connection(config) # :nodoc:
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]

0 comments on commit b319e69

Please sign in to comment.