Exception: ActiveItem::RecordInvalid
- Inherits:
-
StandardError
- Object
- StandardError
- ActiveItem::RecordInvalid
- Defined in:
- lib/active_item/errors.rb
Overview
Raised by save! when validations fail.
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(record = nil) ⇒ RecordInvalid
constructor
A new instance of RecordInvalid.
Constructor Details
#initialize(record = nil) ⇒ RecordInvalid
Returns a new instance of RecordInvalid.
11 12 13 14 15 |
# File 'lib/active_item/errors.rb', line 11 def initialize(record = nil) @record = record = record ? "Validation failed: #{record.errors..join(', ')}" : 'Validation failed' super() end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
9 10 11 |
# File 'lib/active_item/errors.rb', line 9 def record @record end |