Skip to content

Instantly share code, notes, and snippets.

@rugyoga
Created September 5, 2022 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rugyoga/734af859c0636769f28bfe150244469c to your computer and use it in GitHub Desktop.
Save rugyoga/734af859c0636769f28bfe150244469c to your computer and use it in GitHub Desktop.
Change list
@spec changelist(term) :: [change_t()]
defp changelist(r = %_{__audit_trail__: audit_trail}) do
if audit_trail, do: [{r, audit_trail} | changelist(record(audit_trail))], else: []
end
defp changelist(_), do: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment