Exception: Mongoid::Errors::InvalidDatabase

Inherits:
MongoidError show all
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.

Examples:

Create the error.

InvalidDatabase.new("Not a DB")

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Method Summary collapse

Methods inherited from MongoidError

#translate

Constructor Details

#initialize(database) ⇒ InvalidDatabase

Returns a new instance of InvalidDatabase.



12
13
14
15
16
# File 'lib/mongoid/errors/invalid_database.rb', line 12

def initialize(database)
  super(
    translate("invalid_database", { :name => database.class.name })
  )
end