ex_audit v0.2.0 ExAudit.Repo behaviour View Source

Link to this section Summary

Callbacks

Gathers the version history for the given struct, ordered by the time the changes happened from newest to oldest

Undoes the changes made in the given version, as well as all of the following versions

Link to this section Callbacks

Link to this callback history(struct, opts) View Source
history(struct(), opts :: list()) :: [version :: struct()]

Gathers the version history for the given struct, ordered by the time the changes happened from newest to oldest.

Options

  • :render_structs if true, renders the resulting struct of the patch for every version in its history. This will shift the ids of the versions one down, so visualisations are correct and corresponding “Revert” buttons revert the struct back to the visualized state. Will append an additional version that contains the oldest ID and the oldest struct known. In most cases, the original will be nil which means if this version would be reverted, the struct would be deleted. false by default.
Link to this callback revert(version, opts) View Source
revert(version :: struct(), opts :: list()) ::
  {:ok, struct()} |
  {:error, changeset :: Ecto.Changeset.t()}

Undoes the changes made in the given version, as well as all of the following versions.

Inserts a new version entry in the process, with the :rollback flag set to true