Exception: Humanoid::Errors::InvalidCollection

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/humanoid/errors.rb

Overview

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

Example:

InvalidCollection.new(Address)

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ InvalidCollection

Returns a new instance of InvalidCollection.



66
67
68
# File 'lib/humanoid/errors.rb', line 66

def initialize(klass)
  @klass = klass
end

Instance Method Details

#messageObject



69
70
71
72
73
# File 'lib/humanoid/errors.rb', line 69

def message
  "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