Exception: OccamsRecord::Results::MissingEagerLoadError
- Inherits:
-
StandardError
- Object
- StandardError
- OccamsRecord::Results::MissingEagerLoadError
- Defined in:
- lib/occams-record/results.rb
Overview
Exception when an unloaded association is called on a result row
Instance Attribute Summary collapse
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(model_name, name) ⇒ MissingEagerLoadError
constructor
A new instance of MissingEagerLoadError.
- #message ⇒ Object
Constructor Details
#initialize(model_name, name) ⇒ MissingEagerLoadError
Returns a new instance of MissingEagerLoadError.
133 134 135 |
# File 'lib/occams-record/results.rb', line 133 def initialize(model_name, name) @model_name, @name = model_name, name end |
Instance Attribute Details
#model_name ⇒ Object (readonly)
Returns the value of attribute model_name.
130 131 132 |
# File 'lib/occams-record/results.rb', line 130 def model_name @model_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
131 132 133 |
# File 'lib/occams-record/results.rb', line 131 def name @name end |
Instance Method Details
#message ⇒ Object
137 138 139 |
# File 'lib/occams-record/results.rb', line 137 def "The association '#{name}' is unavailable on #{model_name} because it has not been eager loaded!" end |