We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 143f85a commit ffb923cCopy full SHA for ffb923c
lib/usage_tracker/adapters/mongodb.rb
@@ -9,6 +9,11 @@ class Mongodb
9
def initialize (settings)
10
@database =
11
db = Mongo::Connection.new(settings.database['host'], settings.database['port']).db(settings.database['name'])
12
+
13
+ if settings.database['username'] || settings.database['password']
14
+ db.authenticate(settings.database['username'], settings.database['password'])
15
+ end
16
17
@collection = db[settings.database['collection']]
18
db
19
rescue Errno::ECONNREFUSED, Mongo::ConnectionError => e
0 commit comments