123456789_123456789_123456789_123456789_123456789_

Exception: Mongoid::Errors::UnrecognizedResolver

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, MongoidError, StandardError
Instance Chain:
self, MongoidError, StandardError
Inherits: Mongoid::Errors::MongoidError
Defined in: lib/mongoid/errors/unrecognized_resolver.rb

Overview

Raised when a model resolver is referenced, but not registered.

class Manager
  include Mongoid::Document
  belongs_to :unit, polymorphic: :org
end

If :org has not previously been registered as a model resolver, ::Mongoid will raise UnrecognizedResolver when it tries to resolve a manager’s unit.

Constant Summary

MongoidError - Inherited

BASE_KEY

Class Method Summary

Instance Attribute Summary

Instance Method Summary

MongoidError - Inherited

#compose_message

Compose the message.

#translate

Given the key of the specific error and the options hash, translate the message.

#translate_problem

Create the problem.

#translate_resolution

Create the resolution.

#translate_summary

Create the summary.

Constructor Details

.new(resolver) ⇒ UnrecognizedResolver

[ GitHub ]

  
# File 'lib/mongoid/errors/unrecognized_resolver.rb', line 16

def initialize(resolver)
  super(
    compose_message(
      'unrecognized_resolver',
      resolver: resolver.inspect,
      resolvers: [ :default, *Mongoid::ModelResolver.resolvers.keys ].inspect
    )
  )
end