Add mongolab configuration to mongo backend #49

Merged
merged 1 commit into from Jun 5, 2012
@@ -21,7 +21,8 @@ def initialize
def connection
@connection ||= begin
- uri = URI.parse(ENV['MONGOHQ_URL'].to_s)
+ host_uri = (ENV['MONGOHQ_URL'] || ENV['MONGOLAB_URI']).to_s
+ uri = URI.parse(host_uri)
database = uri.path.empty? ? 'qu' : uri.path[1..-1]
options = {}
if uri.password