Exception: Mongoid::Errors::ImmutableAttribute
- Inherits:
-
MongoidError
- Object
- StandardError
- MongoidError
- Mongoid::Errors::ImmutableAttribute
- Defined in:
- lib/mongoid/errors/immutable_attribute.rb
Overview
This error is raised when attempting the change the value of an immutable attribute. For example, the _id attribute is immutable, and attempting to change it on a document that has already been persisted will result in this error.
Constant Summary
Constants inherited from MongoidError
Instance Attribute Summary
Attributes inherited from MongoidError
#problem, #resolution, #summary
Instance Method Summary collapse
-
#initialize(name, value) ⇒ ImmutableAttribute
constructor
Create the new error.
Methods inherited from MongoidError
Constructor Details
#initialize(name, value) ⇒ ImmutableAttribute
Create the new error.
20 21 22 23 24 |
# File 'lib/mongoid/errors/immutable_attribute.rb', line 20 def initialize(name, value) super( ("immutable_attribute", { name: name, value: value }) ) end |