Class: ViewModel::ActiveRecord::ReferencedCollectionUpdate::Functional

Inherits:
AbstractCollectionUpdate::Functional show all
Defined in:
lib/view_model/active_record/update_data.rb

Instance Attribute Summary

Attributes inherited from AbstractCollectionUpdate::Functional

#actions

Instance Method Summary collapse

Methods inherited from AbstractCollectionUpdate::Functional

#check_for_duplicates!, #contents, #initialize, #removed_vm_refs, #vm_references

Constructor Details

This class inherits a constructor from ViewModel::ActiveRecord::AbstractCollectionUpdate::Functional

Instance Method Details

#resolve_vm_reference(ref, update_context) ⇒ Object



337
338
339
# File 'lib/view_model/active_record/update_data.rb', line 337

def resolve_vm_reference(ref, update_context)
  update_context.resolve_reference(ref, nil).viewmodel_reference
end

#used_vm_refs(update_context) ⇒ Object



331
332
333
334
335
# File 'lib/view_model/active_record/update_data.rb', line 331

def used_vm_refs(update_context)
  references.map do |ref|
    resolve_vm_reference(ref, update_context)
  end
end