Sha256: 8035163cdd27005ee8c4da875932f2964530b6fa8e36fc52df4b678e0ac30aa0
Contents?: true
Size: 373 Bytes
Versions: 15
Compression:
Stored size: 373 Bytes
Contents
database_config_file = File.join(Rails.root, "/config/database.mongo.yml") yaml_content = File.read(database_config_file) db_config = YAML::load(yaml_content) if db_config[Rails.env] && db_config[Rails.env]['adapter'] == 'mongodb' mongo = db_config[Rails.env] MongoMapper.connection = Mongo::Connection.new(mongo['host']) MongoMapper.database = mongo['database'] end
Version data entries
15 entries across 15 versions & 1 rubygems