Exception: Mongoid::Errors::DocumentNotDestroyed

Inherits:
MongoidError
  • Object
show all
Defined in:
lib/mongoid/errors/document_not_destroyed.rb

Overview

Raised when attempting to destroy a document that had destroy callbacks return false.

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Attribute Summary

Attributes inherited from MongoidError

#problem, #resolution, #summary

Instance Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(id, klass) ⇒ DocumentNotDestroyed

Instantiate the exception.

Examples:

Create the error.

DocumentNotDestroyed.new(Band)

Parameters:

  • id (Object)

    The document id.

  • klass (Class)

    The document class.



18
19
20
# File 'lib/mongoid/errors/document_not_destroyed.rb', line 18

def initialize(id, klass)
  super(compose_message("document_not_destroyed", { id: id.inspect, klass: klass }))
end