lib/yogi_berra/catcher.rb in yogi_berra-0.0.11 vs lib/yogi_berra/catcher.rb in yogi_berra-0.0.12
- old
+ new
@@ -62,9 +62,12 @@
port = @@settings["port"]
replica_set = @@settings["replica_set"]
client = db_client(host, port, replica_set)
if client
@@connection = client[@@settings["database"]]
+ if @@connection && @@settings["username"] && @@settings["password"]
+ @@connection.authenticate(@@settings["username"], @@settings["password"])
+ end
else
YogiBerra::Logger.log("Couldn't connect to the mongo database on host: #{host} port: #{port}.", :error)
end
else
YogiBerra::Logger.log("Couldn't load the yogi.yml file.", :error) if load_settings
\ No newline at end of file