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



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

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