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.



290
291
292
293
# File 'lib/view_model/deserialization_error.rb', line 290

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

Instance Attribute Details

#associationObject (readonly)

Returns the value of attribute association.



288
289
290
# File 'lib/view_model/deserialization_error.rb', line 288

def association
  @association
end

Instance Method Details

#detailObject



295
296
297
# File 'lib/view_model/deserialization_error.rb', line 295

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

#metaObject



299
300
301
# File 'lib/view_model/deserialization_error.rb', line 299

def meta
  super.merge(association: association)
end