class Mongoid::Errors::InvalidDatabase

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 Create the error.

InvalidDatabase.new("Not a DB")

Public Class Methods

new(database) click to toggle source
Calls superclass method
# File lib/mongoid/errors/invalid_database.rb, line 11
def initialize(database)
  super(
    compose_message("invalid_database", { name: database.class.name })
  )
end