Exception: Mongoid::Errors::InvalidIndex

Inherits:
MongoidError
  • Object
show all
Defined in:
lib/mongoid/errors/invalid_index.rb

Overview

Raised when an invalid index is defined.

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Attribute Summary

Attributes inherited from MongoidError

#problem, #resolution, #summary

Instance Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(klass, spec, options) ⇒ InvalidIndex

Create the new error.

Examples:

Create the error.

InvalidIndex.new(Band, name: 1)

Parameters:

  • klass (Class)

    The model class.

  • spec (Hash)

    The invalid specification.

  • options (Hash)

    The invalid options.



18
19
20
21
22
23
24
25
# File 'lib/mongoid/errors/invalid_index.rb', line 18

def initialize(klass, spec, options)
  super(
    compose_message(
      "invalid_index",
      { klass: klass.name, spec: spec, options: options }
    )
  )
end