Methods

Class/Module Index [+]

Quicksearch

Mongoid::Errors::InvalidField

This error is raised when trying to create a field that conflicts with an already defined method.

Public Class Methods

new(klass, name) click to toggle source

Create the new error.

@example Create the error.

InvalidField.new(person, :crazy_method_name)

@param [ Class ] klass The document class. @param [ Symbol ] name The method name.

# File lib/mongoid/errors/invalid_field.rb, line 15
def initialize(klass, name)
  super(
    compose_message(
      "invalid_field",
      {
        name: name,
        origin: origin(klass, name),
        file: location(klass, name)[0],
        line: location(klass, name)[1]
      }
    )
  )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.