Exception: Mongoid::Errors::InvalidDatabase
- Inherits:
-
MongoidError
- Object
- StandardError
- MongoidError
- Mongoid::Errors::InvalidDatabase
- Defined in:
- lib/mongoid/errors/invalid_database.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")
Constant Summary
Constants inherited from MongoidError
Instance Method Summary collapse
-
#initialize(database) ⇒ InvalidDatabase
constructor
A new instance of InvalidDatabase.
Methods inherited from MongoidError
Constructor Details
#initialize(database) ⇒ InvalidDatabase
Returns a new instance of InvalidDatabase.
13 14 15 16 17 |
# File 'lib/mongoid/errors/invalid_database.rb', line 13 def initialize(database) super( translate("invalid_database", { :name => database.class.name }) ) end |