Skip to content

Commit 2b1b4ed

Browse files
committed
ummm yeah. Let's use our db
1 parent db83558 commit 2b1b4ed

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

hackety.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
require 'rdiscount'
2626

2727
#we need to set up a secret to encrypt our sessions with
28-
use Rack::Session::Cookie, :secret => 'h4ck3ty h4ck f0r gr347 g00d'
28+
use Rack::Session::Cookie, :secret => 'h4ck3ty h4ck f0r gr347 g00d noep lolol'
2929

3030
#we also have to let the world know we want to use flashes
3131
use Rack::Flash
@@ -62,9 +62,11 @@
6262
#for all environments,
6363
configure do
6464
if ENV['MONGOHQ_URL']
65-
MongoMapper.config = {ENV['RACK_ENV'] => {'uri' => ENV['MONGOHQ_URL']}}
65+
MongoMapper.connection = Mongo::Connection.new(ENV['MONGOHQ_HOST'], ENV['MONGOHQ_PORT'])
66+
MongoMapper.database = ENV['MONGOHQ_DATABASE']
67+
MongoMapper.database.authenticate(ENV['MONGOHQ_USER'],ENV['MONGOHQ_PASSWORD'])
68+
6669
MongoMapper.database = ENV['MONGOHQ_DATABASE']
67-
MongoMapper.connect("production")
6870
else
6971
MongoMapper.connection = Mongo::Connection.new('localhost')
7072
MongoMapper.database = "hackety-development"

0 commit comments

Comments
 (0)