Exception: Mongoid::Errors::NestedAttributesMetadataNotFound

Inherits:
MongoidError
  • Object
show all
Defined in:
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



18
19
20
21
22
23
24
25
# File 'lib/mongoid/errors/nested_attributes_metadata_not_found.rb', line 18

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