class ViewModel::ActiveRecord::AbstractCollectionUpdate::Functional

associations.
either UpdateData for nested associations or references for referenced
Wraps an ordered list of FunctionalUpdates, each of whose ‘contents` are

def check_for_duplicates!(update_context, blame)

def check_for_duplicates!(update_context, blame)
  duplicate_vm_refs = vm_references(update_context).duplicates
  if duplicate_vm_refs.present?
    formatted_invalid_ids = duplicate_vm_refs.keys.map(&:to_s).join(', ')
    raise ViewModel::DeserializationError::InvalidStructure.new("Duplicate functional update targets: [#{formatted_invalid_ids}]", blame)
  end
end

def contents

def contents
  actions.lazy
    .reject { |action| action.is_a?(FunctionalUpdate::Remove) }
    .flat_map(&:contents)
    .to_a
end

def initialize(actions)

def initialize(actions)
  @actions = actions
end

def removed_vm_refs

def removed_vm_refs
  actions.lazy
    .select { |action| action.is_a?(FunctionalUpdate::Remove) }
    .flat_map(&:removed_vm_refs)
    .to_a
end

def used_vm_refs(_update_context)

reference or value.
Resolve ViewModel::References used in the update's contents, whether by
def used_vm_refs(_update_context)
  raise RuntimeError.new('abstract method')
end

def vm_references(update_context)

def vm_references(update_context)
  used_vm_refs(update_context) + removed_vm_refs
end