Created
July 16, 2012 06:08
-
-
Save kimenye/3121021 to your computer and use it in GitHub Desktop.
Sinatra + MongoMapper + MongoHQ + Heroku
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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