Method: Mongoid::Errors::InvalidScope#initialize

Defined in:
lib/mongoid/errors/invalid_scope.rb

#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.



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