Exception: OccamsRecord::MissingDataError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/occams-record/errors.rb

Overview

Exception raised when a record wasn’t loaded with all requested data

Direct Known Subclasses

MissingColumnError, MissingEagerLoadError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record, name) ⇒ MissingDataError



13
14
15
16
# File 'lib/occams-record/errors.rb', line 13

def initialize(record, name)
  @record, @name = record, name
  @model_name = record.class.model_name
end

Instance Attribute Details

#model_nameString (readonly)



5
6
7
# File 'lib/occams-record/errors.rb', line 5

def model_name
  @model_name
end

#nameSymbol (readonly)



9
10
11
# File 'lib/occams-record/errors.rb', line 9

def name
  @name
end

#recordOccamsRecord::Result::Row (readonly)



7
8
9
# File 'lib/occams-record/errors.rb', line 7

def record
  @record
end

Instance Method Details

#to_sString



19
20
21
# File 'lib/occams-record/errors.rb', line 19

def to_s
  message
end