paper_trail v0.7.2 PaperTrail

Summary

Functions

Deletes a record from the database with a related version insertion in one transaction

Same as delete/2 but returns only the model struct or raises if the changeset is invalid

Gets the current model record/struct of a version

Gets the last version of a record

Gets the last version of a record given its module reference and its id

Gets all the versions of a record

Gets all the versions of a record given a module and its id

Inserts a record to the database with a related version insertion in one transaction

Same as insert/2 but returns only the model struct or raises if the changeset is invalid

Updates a record from the database with a related version insertion in one transaction

Same as update/2 but returns only the model struct or raises if the changeset is invalid

Functions

delete(struct, options \\ [origin: nil, meta: nil, originator: nil])

Deletes a record from the database with a related version insertion in one transaction

delete!(struct, options \\ [origin: nil, meta: nil, originator: nil])

Same as delete/2 but returns only the model struct or raises if the changeset is invalid.

get_current_model(version)

Gets the current model record/struct of a version

get_version(record)

Gets the last version of a record

get_version(model, id)

Gets the last version of a record given its module reference and its id

get_versions(record)

Gets all the versions of a record

get_versions(model, id)

Gets all the versions of a record given a module and its id

insert(changeset, options \\ [origin: nil, meta: nil, originator: nil])

Inserts a record to the database with a related version insertion in one transaction

insert!(changeset, options \\ [origin: nil, meta: nil, originator: nil])

Same as insert/2 but returns only the model struct or raises if the changeset is invalid.

update(changeset, options \\ [origin: nil, meta: nil, originator: nil])

Updates a record from the database with a related version insertion in one transaction

update!(changeset, options \\ [origin: nil, meta: nil, originator: nil])

Same as update/2 but returns only the model struct or raises if the changeset is invalid.