Alternera. Resource. Changes. SetReferenceByKey
(alternera_resource_sdk v0.9.0)
Copy Markdown
View Source
On a create or update that accepts a belongs_to's attribute: the
argument <relationship>_<key> names the record by its lookup key
(base_currency_code: "EUR") instead of its id, and this change sets the
attribute to that record's id, found in the changeset's tenant as its
actor. A key no record has is an error on the argument; nil clears the
reference. Without the argument the attribute is left as it is, so the
id still works (Transformers.AddReferenceKeys).