Exception: Mongoid::Errors::InvalidCollection
- Defined in:
- lib/mongoid/errors.rb
Overview
This error is raised when trying to access a Mongo::Collection from an embedded document.
Instance Method Summary collapse
-
#initialize(klass) ⇒ InvalidCollection
constructor
A new instance of InvalidCollection.
- #message ⇒ Object
Constructor Details
#initialize(klass) ⇒ InvalidCollection
Returns a new instance of InvalidCollection.
35 36 37 |
# File 'lib/mongoid/errors.rb', line 35 def initialize(klass) @klass = klass end |
Instance Method Details
#message ⇒ Object
38 39 40 41 42 |
# File 'lib/mongoid/errors.rb', line 38 def "Access to the collection for #{@klass.name} is not allowed " + "since it is an embedded document, please access a collection from " + "the root document" end |