Exception: ActiveModel::ValidationError
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
StandardError
|
|
Instance Chain:
self,
StandardError
|
|
Inherits: |
StandardError
|
Defined in: | activemodel/lib/active_model/validations.rb |
Overview
Raised by validate!
when the model is invalid. Use the #model method to retrieve the record which did not validate.
begin
complex_operation_that_internally_calls_validate!
rescue ActiveModel::ValidationError => invalid
puts invalid.model.errors
end
Class Method Summary
- .new(model) ⇒ ValidationError constructor
Instance Attribute Summary
- #model readonly
Constructor Details
.new(model) ⇒ ValidationError
Instance Attribute Details
#model (readonly)
[ GitHub ]# File 'activemodel/lib/active_model/validations.rb', line 461
attr_reader :model