Exception: Mongoid::Errors::InvalidField
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
MongoidError ,
StandardError
|
|
Instance Chain:
self,
MongoidError ,
StandardError
|
|
Inherits: |
Mongoid::Errors::MongoidError
|
Defined in: | lib/mongoid/errors/invalid_field.rb |
Overview
This error is raised when trying to create a field that conflicts with an already defined method.
Constant Summary
MongoidError
- Inherited
Class Method Summary
-
.new(klass, field, name) ⇒ InvalidField
constructor
Internal use only
Internal use only
Create the new error.
Instance Attribute Summary
MongoidError
- Inherited
Instance Method Summary
-
#location(klass, name) ⇒ Array<String, Integer>
private
Get the location of the method.
-
#origin(klass, name) ⇒ Class | Module
private
Get the queryable of the method.
MongoidError
- Inherited
#compose_message | Compose the message. |
#translate | Given the key of the specific error and the options hash, translate the message. |
#translate_problem | Create the problem. |
#translate_resolution | Create the resolution. |
#translate_summary | Create the summary. |
Instance Method Details
#location(klass, name) ⇒ Array<String, Integer> (private)
Get the location of the method.
# File 'lib/mongoid/errors/invalid_field.rb', line 60
def location(klass, name) @location ||= (klass.instance_method(name).source_location || [ "Unknown", 0 ]) end
#origin(klass, name) ⇒ Class
| Module
(private)
Get the queryable of the method.
# File 'lib/mongoid/errors/invalid_field.rb', line 47
def origin(klass, name) klass.instance_method(name).owner end