Exception: Mongoid::Errors::InvalidScope

Inherits:
MongoidError
  • Object
show all
Defined in:
build/mongoid-8.1/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 Attribute Summary

Attributes inherited from MongoidError

#problem, #resolution, #summary

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.



16
17
18
19
20
# File 'build/mongoid-8.1/lib/mongoid/errors/invalid_scope.rb', line 16

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