Exception: Mongoid::Errors::InvalidField

Inherits:
MongoidError show all
Defined in:
lib/mongoid/errors/invalid_field.rb

Overview

This error is raised when trying to create a field that conflicts with a Mongoid internal attribute or method.

Examples:

Create the error.

InvalidField.new('collection')

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Method Summary collapse

Methods inherited from MongoidError

#translate

Constructor Details

#initialize(name) ⇒ InvalidField

Returns a new instance of InvalidField.



11
12
13
14
15
# File 'lib/mongoid/errors/invalid_field.rb', line 11

def initialize(name)
  super(
    translate("invalid_field", { :name => name })
  )
end