Skip to content

Instantly share code, notes, and snippets.

@michelson
Created January 28, 2010 16:30
Show Gist options
  • Save michelson/288888 to your computer and use it in GitHub Desktop.
Save michelson/288888 to your computer and use it in GitHub Desktop.
begin YAML.load_file("#{:config}/mongo_config.yml")
MONGOCONNECTION = YAML.load_file("#{:config}/mongo_config.yml")[ENV['RACK_ENV']]
rescue => e
puts "WARNING! loading config file mongo_config.yml , #{e}"
end
MongoMapper.connection = Mongo::Connection.new(MONGOCONNECTION['ip'])
MongoMapper.database = MONGOCONNECTION['db']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment