Exception: ViewModel::DeserializationError::DuplicateOwner

Inherits:
InvalidRequest 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 AbstractErrorWithBlame

#meta

Methods inherited from AbstractError

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

Constructor Details

#initialize(association_name, parents) ⇒ DuplicateOwner

Returns a new instance of DuplicateOwner.



234
235
236
237
# File 'lib/view_model/deserialization_error.rb', line 234

def initialize(association_name, parents)
  @association_name = association_name
  super(parents)
end

Instance Attribute Details

#association_nameObject (readonly)

Returns the value of attribute association_name.



232
233
234
# File 'lib/view_model/deserialization_error.rb', line 232

def association_name
  @association_name
end

Instance Method Details

#detailObject



239
240
241
# File 'lib/view_model/deserialization_error.rb', line 239

def detail
  "Multiple parents attempted to claim the same owned '#{association_name}' reference: " + nodes.map(&:to_s).join(', ')
end