Browse files

Default to postgres db.

  • Loading branch information...
1 parent 1fcee71 commit a51cac48e2530f6602d3b77db72676b2cade0c19 @wayneeseguin committed Apr 24, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/psql-cm/database.rb
View
3 lib/psql-cm/database.rb
@@ -85,7 +85,8 @@ def configure!
sslmode = query.detect { |k| k.match /sslmode=/ }.to_s.sub(/.*=/,'')
database = uri.path.split('/').first.to_s
- database = @config[:dbname] if database.empty?
+ database = @config[:dbname] || 'postgres' if database.empty?
+
unless @config.databases.detect { |name| name == database }
@config.databases << database

0 comments on commit a51cac4

Please sign in to comment.