Exception: ViewModel::DeserializationError::InvalidAssociationType
- Inherits:
-
InvalidRequest
- Object
- StandardError
- AbstractError
- AbstractErrorWithBlame
- ViewModel::DeserializationError
- InvalidRequest
- ViewModel::DeserializationError::InvalidAssociationType
- Defined in:
- lib/view_model/deserialization_error.rb
Overview
The target of an association was not a valid view type for that association.
Instance Attribute Summary collapse
-
#association ⇒ Object
readonly
Returns the value of attribute association.
-
#target_type ⇒ Object
readonly
Returns the value of attribute target_type.
Attributes inherited from AbstractErrorWithBlame
Instance Method Summary collapse
- #detail ⇒ Object
-
#initialize(association, target_type, node) ⇒ InvalidAssociationType
constructor
A new instance of InvalidAssociationType.
- #meta ⇒ Object
Methods inherited from ViewModel::DeserializationError
Methods inherited from AbstractError
#aggregation?, #causes, #code, #exception, #status, #title, #to_s, #view
Constructor Details
#initialize(association, target_type, node) ⇒ InvalidAssociationType
Returns a new instance of InvalidAssociationType.
148 149 150 151 152 |
# File 'lib/view_model/deserialization_error.rb', line 148 def initialize(association, target_type, node) @association = association @target_type = target_type super([node]) end |
Instance Attribute Details
#association ⇒ Object (readonly)
Returns the value of attribute association.
147 148 149 |
# File 'lib/view_model/deserialization_error.rb', line 147 def association @association end |
#target_type ⇒ Object (readonly)
Returns the value of attribute target_type.
147 148 149 |
# File 'lib/view_model/deserialization_error.rb', line 147 def target_type @target_type end |
Instance Method Details
#detail ⇒ Object
154 155 156 |
# File 'lib/view_model/deserialization_error.rb', line 154 def detail "Invalid target viewmodel type '#{target_type}' for association '#{association}'" end |
#meta ⇒ Object
158 159 160 161 |
# File 'lib/view_model/deserialization_error.rb', line 158 def super.merge(association: association, target_type: target_type) end |