Sha256: aca670f46b8728e04d9325c416824ea0f51fa4806ee4de84874a5a8b61547f47
Contents?: true
Size: 785 Bytes
Versions: 8
Compression:
Stored size: 785 Bytes
Contents
# frozen_string_literal: true module Mongoid module Errors # 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. class ImmutableAttribute < MongoidError # Create the new error. # # @example Create the new error. # ImmutableAttribute.new(:_id, "1234") # # @param [ Symbol | String ] name The name of the attribute. # @param [ Object ] value The attempted set value. def initialize(name, value) super( compose_message("immutable_attribute", { name: name, value: value }) ) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems