Exception: Caprese::AssociationNotFoundError
- Defined in:
- lib/caprese/errors.rb
Overview
Thrown when an association was not found when calling ‘record.association()`
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
- #full_message ⇒ Object
-
#initialize(name) ⇒ AssociationNotFoundError
constructor
A new instance of AssociationNotFoundError.
Methods inherited from Error
#as_json, #i18n_scope, #with_header
Constructor Details
#initialize(name) ⇒ AssociationNotFoundError
Returns a new instance of AssociationNotFoundError.
57 58 59 60 |
# File 'lib/caprese/errors.rb', line 57 def initialize(name) super field: :name, code: :not_found, t: { model: 'relationship', value: name } @header = { status: :not_found } end |
Instance Method Details
#full_message ⇒ Object
62 63 64 |
# File 'lib/caprese/errors.rb', line 62 def I18n.t("#{i18n_scope}.parameters.not_found", t) end |