Exception: Mongoid::Errors::InvalidField
- Defined in:
- lib/mongoid/errors.rb
Overview
This error is raised when trying to create a field that conflicts with a Mongoid internal attribute or method.
Example:
InvalidField.new('collection')
Instance Method Summary collapse
-
#initialize(name) ⇒ InvalidField
constructor
A new instance of InvalidField.
- #message ⇒ Object
Constructor Details
#initialize(name) ⇒ InvalidField
Returns a new instance of InvalidField.
97 98 99 |
# File 'lib/mongoid/errors.rb', line 97 def initialize(name) @name = name end |
Instance Method Details
#message ⇒ Object
100 101 102 103 104 105 |
# File 'lib/mongoid/errors.rb', line 100 def "Defining a field named '#{@name}' is not allowed. " + "Do not define fields that conflict with Mongoid internal attributes " + "or method names. Use Document#instance_methods to see what " + "names this includes." end |