Exception: Mongoid::Errors::ReadonlyDocument

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

Overview

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

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

Instantiate the exception.

Examples:

Create the error.

ReadonlyDocument.new(Band)

Parameters:

  • klass (Class)

    The document class.



17
18
19
# File 'lib/mongoid/errors/readonly_document.rb', line 17

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