class Mongoid::Errors::InvalidFieldType

This error is raised when trying to define a field using a :type option value that is not present in the field type mapping.

Public Class Methods

new(klass, field, type) click to toggle source

Create the new error.

@example Instantiate the error.

InvalidFieldType.new('Person', 'first_name', 'stringgy')

@param [ String ] klass The model class. @param [ String ] field The field on which the invalid type is used. @param [ Symbol | String ] type The value of the field :type option.

Calls superclass method
# File lib/mongoid/errors/invalid_field_type.rb, line 19
def initialize(klass, field, type)
  super(
    compose_message('invalid_field_type',
      klass: klass, field: field, type_inspection: type.inspect)
  )
end