Reads a field from the source instance of an AssignmentRelationship.
Traverses AssignmentRelationship in reverse — filtering by target_id = current.id
— to reach the source instances (pool owners) that assigned something to this instance,
then returns the named field from each.
Options
field:(required) — atom naming the field to read from the source instance (e.g.:name,:type).via:(optional) — list of alias atoms to step through. Each step filtersAssignmentRelationshipby the alias and followssource_idto the next set of instances. Multi-hop is supported by chaining steps. When omitted, all assignments wheretarget_id = current.idare traversed without alias filtering.
Examples
# Name of the CVC that holds the :svlan assignment slot on this AVC
calculate :cvc_id, {:array, :string},
{Diffo.Provider.Calculations.FieldViaAssignedRelationship, [via: [:svlan], field: :name]}
# Name of every instance that has ever assigned anything to this one
calculate :assigner_names, {:array, :string},
{Diffo.Provider.Calculations.FieldViaAssignedRelationship, [field: :name]}
Summary
Functions
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.init/1.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.
Functions
Callback implementation for Ash.Resource.Calculation.describe/1.
Callback implementation for Ash.Resource.Calculation.has_expression?/0.
Callback implementation for Ash.Resource.Calculation.init/1.
Callback implementation for Ash.Resource.Calculation.strict_loads?/0.