Permalink
Browse files

Mingo.connect now accepts an options hash

  • Loading branch information...
1 parent 1f436ca commit f83e5a113744a206c6cad097d433d2d35808365b @mislav committed Sep 20, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/mingo/connection.rb
View
6 lib/mingo/connection.rb
@@ -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

0 comments on commit f83e5a1

Please sign in to comment.