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

Version Path
rails3-generators-0.17.6 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.17.5 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.17.4 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.17.3 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.17.2 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.17.1 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.17.0 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.16.1 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.16.0 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.15.0 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.14.0 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.13.0 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.12.1 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.12.0 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb
rails3-generators-0.11.0 lib/generators/mongo_mapper/install/templates/mongo_mapper.rb