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 a record is invalid and cannot be saved.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RecordNotSaved.



96
97
98
99
# File 'lib/active_record/errors.rb', line 96

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

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



94
95
96
# File 'lib/active_record/errors.rb', line 94

def record
  @record
end