Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Mingo.connect now accepts an options hash

  • Loading branch information...
commit f83e5a113744a206c6cad097d433d2d35808365b 1 parent 1f436ca
@mislav authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.