Exception: Mongoid::Errors::InvalidValue

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

Overview

This error is raised when trying to set an attribute with an invalid value. For example when try to set an Array value to a Hash attribute.

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(field_class, value_class) ⇒ InvalidValue

Returns a new instance of InvalidValue.



11
12
13
14
15
# File 'build/mongoid-7.3/lib/mongoid/errors/invalid_value.rb', line 11

def initialize(field_class, value_class)
  super(
    compose_message("invalid_value", { value_class: value_class, field_class: field_class  })
  )
end