Exception: ViewModel::DeserializationError::ReadOnlyAssociation

Inherits:
ViewModel::DeserializationError show all
Defined in:
lib/view_model/deserialization_error.rb

Instance Attribute Summary collapse

Attributes inherited from AbstractErrorWithBlame

#nodes

Instance Method Summary collapse

Methods inherited from ViewModel::DeserializationError

#code

Methods inherited from AbstractError

#aggregation?, #causes, #code, #exception, #status, #title, #to_s, #view

Constructor Details

#initialize(association, node) ⇒ ReadOnlyAssociation

Returns a new instance of ReadOnlyAssociation.



273
274
275
276
# File 'lib/view_model/deserialization_error.rb', line 273

def initialize(association, node)
  @association = association
  super([node])
end

Instance Attribute Details

#associationObject (readonly)

Returns the value of attribute association.



271
272
273
# File 'lib/view_model/deserialization_error.rb', line 271

def association
  @association
end

Instance Method Details

#detailObject



278
279
280
# File 'lib/view_model/deserialization_error.rb', line 278

def detail
  "Cannot edit read only association '#{association}'"
end

#metaObject



282
283
284
# File 'lib/view_model/deserialization_error.rb', line 282

def meta
  super.merge(association: association)
end