Exception: Mongoid::Errors::InvalidDatabase
- Defined in:
- lib/mongoid/errors.rb
Overview
Raised when the database connection has not been set up properly, either by attempting to set an object on the db that is not a Mongo::DB
, or not setting anything at all.
Example:
InvalidDatabase.new("Not a DB")
Instance Method Summary collapse
-
#initialize(database) ⇒ InvalidDatabase
constructor
A new instance of InvalidDatabase.
- #message ⇒ Object
Constructor Details
#initialize(database) ⇒ InvalidDatabase
Returns a new instance of InvalidDatabase.
36 37 38 |
# File 'lib/mongoid/errors.rb', line 36 def initialize(database) @database = database end |
Instance Method Details
#message ⇒ Object
39 40 41 |
# File 'lib/mongoid/errors.rb', line 39 def "Database should be a Mongo::DB, not #{@database.class.name}" end |