adding heroku-friendly mongo config

This commit is contained in:
Jesse Kriss 2010-09-16 09:09:25 +08:00 committed by Diaspora
parent e9009ea609
commit 30e655fd6c

View file

@ -2,8 +2,11 @@
# licensed under the Affero General Public License version 3. See # licensed under the Affero General Public License version 3. See
# the COPYRIGHT file. # the COPYRIGHT file.
if ENV['MONGOHQ_URL']
MongoMapper.config = {RAILS_ENV => {'uri' => ENV['MONGOHQ_URL']}}
else
MongoMapper.connection = Mongo::Connection.new('localhost', 27017) MongoMapper.connection = Mongo::Connection.new('localhost', 27017)
end
MongoMapper.database = "diaspora-#{Rails.env}" MongoMapper.database = "diaspora-#{Rails.env}"