Exception: Mongoid::Errors::InvalidStorageParent

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

Overview

Raised when calling store_in in a sub-class of Mongoid::Document

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Method Summary collapse

Methods inherited from MongoidError

#compose_message

Constructor Details

#initialize(klass) ⇒ InvalidStorageParent

Create the new error.

Examples:

Create the new error.

InvalidStorageParent.new(Person)

Parameters:

  • klass (Class)

    The model class.

Since:

  • 4.0.0



16
17
18
19
20
21
22
23
# File 'lib/mongoid/errors/invalid_storage_parent.rb', line 16

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