Exception: Mongoid::Errors::InvalidCollection

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

Overview

This error is raised when trying to access a Mongo::Collection from an embedded document.

Examples:

Create the error.

InvalidCollection.new(Address)

Constant Summary

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Method Summary (collapse)

Methods inherited from MongoidError

#compose_message

Constructor Details

- (InvalidCollection) initialize(klass)



11
12
13
14
15
# File 'lib/mongoid/errors/invalid_collection.rb', line 11

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