Exception: MassiveRecord::ORM::RecordInvalid
- Inherits:
-
MassiveRecordError
- Object
- StandardError
- MassiveRecordError
- MassiveRecord::ORM::RecordInvalid
- Defined in:
- lib/massive_record/orm/validations.rb
Overview
Raised when save! or create! fails due to invalid record A rescued error contains record which you can read errors from as normal
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(record) ⇒ RecordInvalid
constructor
A new instance of RecordInvalid.
Constructor Details
#initialize(record) ⇒ RecordInvalid
Returns a new instance of RecordInvalid.
11 12 13 14 15 |
# File 'lib/massive_record/orm/validations.rb', line 11 def initialize(record) @record = record errors = @record.errors..join(", ") super(I18n.t("activemodel.errors.messages.record_invalid", :errors => errors)) end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
10 11 12 |
# File 'lib/massive_record/orm/validations.rb', line 10 def record @record end |