Skip to content
Browse files

find auth details in db path

  • Loading branch information...
1 parent b1bf87c commit ba15478a3ed1dfd5cc68ae9ab4f58669d66130a9 @begriffs committed Jul 1, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 db/init.rb
View
6 db/init.rb
@@ -6,8 +6,10 @@ def self.connect env=nil
if ENV['DATABASE_URL']
uri = URI.parse ENV['DATABASE_URL']
opts = {
- 'host' => uri.host,
- 'dbname' => uri.path.split('/')[1]
+ 'host' => uri.host,
+ 'user' => uri.user,
+ 'password' => uri.password,
+ 'dbname' => uri.path.split('/')[1]
}
else
opts = DB::Config[env || settings.environment.to_s]

0 comments on commit ba15478

Please sign in to comment.
Something went wrong with that request. Please try again.