Exception: Mongoid::Errors::ScopeOverwrite

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

Overview

This error is raised when trying to create a scope with an name already taken by another scope or method

Examples:

Create the error.

ScopeOverwrite.new(Person,'teenies')

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(model_name, scope_name) ⇒ ScopeOverwrite

Returns a new instance of ScopeOverwrite.



13
14
15
16
17
18
19
20
# File 'lib/mongoid/errors/scope_overwrite.rb', line 13

def initialize(model_name,scope_name)
  super(
    compose_message(
      "scope_overwrite",
      { model_name: model_name, scope_name: scope_name }
    )
  )
end