Skip to content

Instantly share code, notes, and snippets.

@kimenye
Created July 16, 2012 06:08
Show Gist options
  • Save kimenye/3121021 to your computer and use it in GitHub Desktop.
Save kimenye/3121021 to your computer and use it in GitHub Desktop.
Sinatra + MongoMapper + MongoHQ + Heroku
if ENV['MONGOHQ_URL']
uri = URI.parse(ENV['MONGOHQ_URL'])
MongoMapper.connection = Mongo::Connection.from_uri(ENV['MONGOHQ_URL'])
MongoMapper.database = uri.path.gsub(/^\//, '')
puts ">> db is #{uri.path.gsub(/^\//, '')}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment