Exception: ActiveRecord::RecordNotSaved

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

Overview

Raised by ActiveRecord::Base#save! and ActiveRecord::Base.create! methods when a record is invalid and can not be saved.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, record = nil) ⇒ RecordNotSaved



70
71
72
73
# File 'activerecord/lib/active_record/errors.rb', line 70

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

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record



68
69
70
# File 'activerecord/lib/active_record/errors.rb', line 68

def record
  @record
end