Method: Mongoid::Errors::ReadonlyAttribute#initialize

Defined in:
lib/mongoid/errors/readonly_attribute.rb

#initialize(name, value) ⇒ ReadonlyAttribute

Create the new error.

Examples:

Create the new error.

ReadonlyAttribute.new(:title, "mr")

Parameters:

  • name (Symbol | String)

    The name of the attribute.

  • value (Object)

    The attempted set value.



18
19
20
21
22
# File 'lib/mongoid/errors/readonly_attribute.rb', line 18

def initialize(name, value)
  super(
    compose_message("readonly_attribute", { name: name, value: value })
  )
end