Exception: ActiveRecord::RecordNotSaved

Inherits:
ActiveRecordError show all
Defined in:
lib/active_record/errors.rb

Overview

Raised by ActiveRecord::Base.save! and ActiveRecord::Base.create! methods when record cannot be saved because record is invalid.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, record = nil) ⇒ RecordNotSaved

Returns a new instance of RecordNotSaved.



57
58
59
60
# File 'lib/active_record/errors.rb', line 57

def initialize(message, record = nil)
  @record = record
  super(message)
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



55
56
57
# File 'lib/active_record/errors.rb', line 55

def record
  @record
end