Exception: OccamsRecord::MissingEagerLoadError

Inherits:
MissingDataError show all
Defined in:
lib/occams-record/errors.rb

Overview

Exception when an unloaded association is called on a result row

Instance Attribute Summary

Attributes inherited from MissingDataError

#model_name, #name, #record

Instance Method Summary collapse

Methods inherited from MissingDataError

#initialize, #to_s

Constructor Details

This class inherits a constructor from OccamsRecord::MissingDataError

Instance Method Details

#messageString

Returns:

  • (String)


37
38
39
40
# File 'lib/occams-record/errors.rb', line 37

def message
  loads = @load_trace.to_s
  "Association '#{name}' is unavailable on #{model_name} because it was not eager loaded! Occams Record trace: #{loads}"
end