Exception: ActiveRecord::RecordNotSaved
- Inherits:
-
ActiveRecordError
- Object
- StandardError
- ActiveRecordError
- ActiveRecord::RecordNotSaved
- 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 cannot be saved.
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(message = nil, record = nil) ⇒ RecordNotSaved
constructor
A new instance of RecordNotSaved.
Constructor Details
#initialize(message = nil, record = nil) ⇒ RecordNotSaved
Returns a new instance of RecordNotSaved.
124 125 126 127 |
# File 'activerecord/lib/active_record/errors.rb', line 124 def initialize( = nil, record = nil) @record = record super() end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record
122 123 124 |
# File 'activerecord/lib/active_record/errors.rb', line 122 def record @record end |