Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Commit

Permalink
Mingo.connect now accepts an options hash
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Sep 20, 2011
1 parent 1f436ca commit f83e5a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/mingo/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ def connected?
!!db
end

def connect(dbname_or_uri)
def connect(dbname_or_uri, options = {})
self.collection = nil
self.db = if dbname_or_uri.index('mongodb://') == 0
connection = Mongo::Connection.from_uri(dbname_or_uri)
connection = Mongo::Connection.from_uri(dbname_or_uri, options)
connection.db(connection.auths.last['db_name'])
else
Mongo::Connection.new.db(dbname_or_uri)
Mongo::Connection.new(nil, nil, options).db(dbname_or_uri)
end
end

Expand Down

0 comments on commit f83e5a1

Please sign in to comment.