Exception: Mongoid::Errors::DocumentNotDestroyed

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

Overview

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

Since:

  • 4.0.0

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

Instnatiate the exception.

Examples:

Create the error.

DocumentNotDestroyed.new(Band)

Parameters:

  • id (Object)

    The document id.

  • klass (Class)

    The document class.

Since:

  • 4.0.0



22
23
24
# File 'build/mongoid-7.3/lib/mongoid/errors/document_not_destroyed.rb', line 22

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