require 'mongo'
module MongoCache
  mattr_accessor :connection, :database
end  
Rails.application.class.configure do
  host = config.database_configuration[Rails.env]['mongo']['host'] rescue 'localhost'
  port = config.database_configuration[Rails.env]['mongo']['port'] rescue 27017
  MongoCache.connection = Mongo::Connection.new(host, port) 
  MongoCache.database = config.database_configuration[Rails.env]['mongo']['database'] rescue config.database_configuration[Rails.env]['database']
end
