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



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

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

#used_vm_refs(update_context) ⇒ Object



327
328
329
330
331
# File 'lib/view_model/active_record/update_data.rb', line 327

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