Method: MongoMapper::Document::ClassMethods#database
- Defined in:
- lib/mongo_mapper/document.rb
#database ⇒ Mongo::DB
Returns the database the document should use. Defaults to
MongoMapper.database if other database is not set.
274 275 276 277 278 279 280 |
# File 'lib/mongo_mapper/document.rb', line 274 def database if database_name.nil? MongoMapper.database else connection.db(database_name) end end |