Exception: Mongoid::Errors::InvalidScope

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

Since:

  • 3.0.0



19
20
21
22
23
# File 'build/mongoid-7.3/lib/mongoid/errors/invalid_scope.rb', line 19

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