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.



251
252
253
254
# File 'lib/view_model/deserialization_error.rb', line 251

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.



249
250
251
# File 'lib/view_model/deserialization_error.rb', line 249

def association_name
  @association_name
end

Instance Method Details

#detailObject



256
257
258
# File 'lib/view_model/deserialization_error.rb', line 256

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