Exception: Mongoid::Errors::ReadonlyDocument

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

Overview

Raised when attempting to persist a document that was loaded from the database with partial fields.

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(klass) ⇒ ReadonlyDocument

Instnatiate the exception.

Examples:

Create the error.

ReadonlyDocument.new(Band)

Parameters:

  • klass (Class)

    The document class.

Since:

  • 4.0.0



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

def initialize(klass)
  super(compose_message("readonly_document", { klass: klass }))
end