Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating DB for mongohq addon.

  • Loading branch information...
commit 664ae1547295bba2a0eb16657820b34e945fdd52 1 parent 06f4e77
@mbleigh mbleigh authored
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'
Please sign in to comment.
Something went wrong with that request. Please try again.