Skip to content
Browse files

Updating DB for mongohq addon.

  • Loading branch information...
1 parent 06f4e77 commit 664ae1547295bba2a0eb16657820b34e945fdd52 Michael Bleigh committed Aug 4, 2010
Showing with 7 additions and 3 deletions.
  1. +7 −3 environment.rb
View
10 environment.rb
@@ -13,9 +13,13 @@
Bundler.require(:default, ENV["RACK_ENV"] || 'development')
-MongoMapper.connection = Mongo::Connection.new(ENV["MONGO_SERVER"], ENV["MONGO_PORT"])
-MongoMapper.database = 'gemsday'
-MongoMapper.database.authenticate(ENV["MONGO_USER"], ENV["MONGO_PASSWORD"]) if ENV["MONGO_USER"] && ENV["MONGO_PASSWORD"]
+if ENV['MONGOHQ_URL']
+ MongoMapper.config = {ENV["RACK_ENV"] => {'uri' => ENV['MONGOHQ_URL']}}
+else
+ MongoMapper.config = {ENV["RACK_ENV"] => {'uri' => 'mongodb://localhost/gemsday'}}
+end
+
+MongoMapper.connect(ENV["RACK_ENV"])
require 'gemsday/gem'
require 'gemsday/tweet'

0 comments on commit 664ae15

Please sign in to comment.
Something went wrong with that request. Please try again.