Skip to content

Instantly share code, notes, and snippets.

@densone
Created February 22, 2011 06:03
Show Gist options
  • Save densone/838283 to your computer and use it in GitHub Desktop.
Save densone/838283 to your computer and use it in GitHub Desktop.
Mongoid.configure do |config|
autocreate_indexes = true
if ENV['MONGOHQ_URL']
conn = Mongo::Connection.from_uri(ENV['MONGOHQ_URL'])
uri = URI.parse(ENV['MONGOHQ_URL'])
config.master = conn.db(uri.path.gsub(/^\//, ''))
else
config.master = Mongo::Connection.from_uri("mongodb://localhost:27017").db('xxxxx_development')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment