Exception: Airtable::ORM::RecordInvalid

Inherits:
Error
  • Object
show all
Defined in:
lib/airtable/orm/errors.rb

Overview

Raised when a record fails validation. Use the #record method to retrieve the record which did not validate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record = nil) ⇒ RecordInvalid

Returns a new instance of RecordInvalid.



22
23
24
25
26
27
28
29
30
# File 'lib/airtable/orm/errors.rb', line 22

def initialize(record = nil)
  if record
    @record = record
    errors = @record.errors.full_messages.join(", ")
    super("Validation failed: #{errors}")
  else
    super("Record invalid")
  end
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



20
21
22
# File 'lib/airtable/orm/errors.rb', line 20

def record
  @record
end