Exception: Mongoid::Errors::NestedAttributesMetadataNotFound

Inherits:
MongoidError
  • Object
show all
Defined in:
build/mongoid-7.3/lib/mongoid/errors/nested_attributes_metadata_not_found.rb

Overview

This error is raised when metadata could not be found when defining nested attributes, or the name was incorrect.

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, name) ⇒ NestedAttributesMetadataNotFound

Create the new metadata error.

Examples:

Create the new metadata error.

NestedAttributesMetadataNotFound.new(klass, name)

Parameters:

  • klass (Class)

    The class of the document.

  • name (Symbol, String)

    The name of the association

Since:

  • 3.0.0



20
21
22
23
24
25
26
27
# File 'build/mongoid-7.3/lib/mongoid/errors/nested_attributes_metadata_not_found.rb', line 20

def initialize(klass, name)
  super(
    compose_message(
      "nested_attributes_metadata_not_found",
      { klass: klass, name: name }
    )
  )
end