Module: Mongoid::MultiDatabase::ClassMethods
- Defined in:
- lib/mongoid/multi_database.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#database ⇒ Mongo::DB
Gets the database from the class.
- #inherited(subclass) ⇒ Object
-
#set_database(name) ⇒ String
Set the database name.
Instance Method Details
#database ⇒ Mongo::DB
Gets the database from the class.
16 |
# File 'lib/mongoid/multi_database.rb', line 16 def database; @database end |
#inherited(subclass) ⇒ Object
30 31 32 33 |
# File 'lib/mongoid/multi_database.rb', line 30 def inherited(subclass) super subclass.set_database(database.dup) if database end |
#set_database(name) ⇒ String
Set the database name.
26 27 28 |
# File 'lib/mongoid/multi_database.rb', line 26 def set_database(name) @database = name.to_s end |