Parent

Methods

Class/Module Index [+]

Quicksearch

Mongoid::Errors::InvalidType

Raised when trying to get or set a value for a defined field, where the type of the object does not match the defined field type.

@example Create the error.

InvalidType.new(Array, "Not an Array")

Public Class Methods

new(klass, value) click to toggle source
# File lib/mongoid/errors/invalid_type.rb, line 10
def initialize(klass, value)
  super(
    translate(
      "invalid_type",
      {
        :klass => klass.name,
        :other => value.class.name,
        :value => value.inspect
      }
    )
  )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.