Exception: CouchResource::RecordInvalid

Inherits:
CouchResourceError show all
Defined in:
lib/couch_resource/validations.rb

Overview

Raised by save! and create! when the record is invalid. Use the record method to retrieve the record which did not validate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record) ⇒ RecordInvalid

Returns a new instance of RecordInvalid.



14
15
16
17
# File 'lib/couch_resource/validations.rb', line 14

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

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



13
14
15
# File 'lib/couch_resource/validations.rb', line 13

def record
  @record
end