PaperTrail (paper_trail v0.11.0) View Source

Link to this section 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.

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.

Link to this section Functions

Link to this function

add_prefix(schema, prefix)

View Source

See PaperTrail.Serializer.add_prefix/2.

Link to this function

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

View Source

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

Link to this function

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

View Source

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

Link to this function

get_current_model(version)

View Source

See PaperTrail.VersionQueries.get_current_model/1.

See PaperTrail.Serializer.get_item_type/1.

See PaperTrail.Serializer.get_model_id/1.

Link to this function

get_sequence_id(table_name)

View Source

See PaperTrail.Serializer.get_sequence_id/1.

See PaperTrail.VersionQueries.get_version/1.

Link to this function

get_version(model_or_record, id_or_options)

View Source

See PaperTrail.VersionQueries.get_version/2.

Link to this function

get_version(model, id, options)

View Source

See PaperTrail.VersionQueries.get_version/3.

See PaperTrail.VersionQueries.get_versions/1.

Link to this function

get_versions(model_or_record, id_or_options)

View Source

See PaperTrail.VersionQueries.get_versions/2.

Link to this function

get_versions(model, id, options)

View Source

See PaperTrail.VersionQueries.get_versions/3.

Link to this function

insert(changeset, options \\ [origin: nil, meta: nil, originator: nil, prefix: nil, model_key: :model, version_key: :version, ecto_options: []])

View Source

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

Link to this function

insert!(changeset, options \\ [origin: nil, meta: nil, originator: nil, prefix: nil, model_key: :model, version_key: :version, ecto_options: []])

View Source

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

Link to this function

make_version_struct(version, model, options)

View Source

See PaperTrail.Serializer.make_version_struct/3.

See PaperTrail.Serializer.serialize/1.

Link to this function

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

View Source

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

Link to this function

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

View Source

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