Exception: ActiveData::ValidationError
- Inherits:
-
ActiveDataError
- Object
- StandardError
- ActiveDataError
- ActiveData::ValidationError
- Defined in:
- lib/active_data/errors.rb
Overview
Backported from active_model 5
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(model) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(model) ⇒ ValidationError
Returns a new instance of ValidationError.
12 13 14 15 16 |
# File 'lib/active_data/errors.rb', line 12 def initialize(model) @model = model errors = @model.errors..join(', ') super(I18n.t(:"#{@model.class.i18n_scope}.errors.messages.model_invalid", errors: errors, default: :'errors.messages.model_invalid')) end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
10 11 12 |
# File 'lib/active_data/errors.rb', line 10 def model @model end |