Audit events should use relation name and not base type name for relations with embedded types
The GetChanges
function in audit.go
uses the name of the embedded type of a relation when determining the index of the change, which results in changes being overwritten when there are two or more relations that share the same base type (an example of this is CollectionAddress
and DeliveryAddress
on Shipments
, where both have the same embedded BaseAddress
type.
Change the case when len(change.Path) >= 3
to use the relation name plus the base type instead of just the base type.