Exception: Mongoid::Errors::InvalidScope

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

Overview

This error is raised when defining a scope of an invalid type.

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(klass, value) ⇒ InvalidScope

Create the error.

Examples:

Create the error.

InvalidScope.new(Band, {})

Parameters:

  • klass (Class)

    The model class.

  • value (Object)

    The attempted scope value.

Since:

  • 3.0.0



17
18
19
20
21
# File 'lib/mongoid/errors/invalid_scope.rb', line 17

def initialize(klass, value)
  super(
    compose_message("invalid_scope", { klass: klass, value: value })
  )
end