Exception: Mongoid::Errors::InvalidValue

Inherits:
MongoidError
  • Object
show all
Defined in:
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 Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(field_class, value_class) ⇒ InvalidValue

Returns a new instance of InvalidValue.



9
10
11
12
13
# File 'lib/mongoid/errors/invalid_value.rb', line 9

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