Exception: Mongoid::Errors::EagerLoad

Inherits:
MongoidError show all
Defined in:
lib/mongoid/errors/eager_load.rb

Overview

This error is raised when attempting to eager load a many to many relation.

Constant Summary

Constants inherited from MongoidError

MongoidError::BASE_KEY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from MongoidError

#translate

Constructor Details

#initialize(name) ⇒ EagerLoad

Create the new eager load error.

Examples:

Create the new eager load error.

EagerLoad.new(:preferences)

Parameters:

  • name (Symbol)

    The name of the relation.

Since:

  • 2.2.0



19
20
21
22
# File 'lib/mongoid/errors/eager_load.rb', line 19

def initialize(name)
  @name = name
  super(translate("eager_load", { :name => name }))
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/mongoid/errors/eager_load.rb', line 9

def name
  @name
end