paper_trail v0.7.9 PaperTrail.VersionQueries
Link to this section Summary
Functions
Gets the current model record/struct of a version
Gets the last version of a record
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
Gets all the versions of a record given a module and its id
Link to this section Functions
Gets the current model record/struct of a version
Gets the last version of a record.
get_version(record :: Ecto.Schema.t, options :: []) :: Ecto.Query.t
get_version(model :: module, id :: pos_integer) :: Ecto.Query.t
Gets the last version of a record.
A list of options is optional, so you can set for example the :prefix of the query, wich allows you to change between different tenants.
Usage example:
iex(1)> PaperTrail.VersionQueries.get_version(record, [prefix: “tenant_id”])
get_version(model :: module, id :: pos_integer, options :: []) :: Ecto.Query.t
Gets the last version of a record given its module reference and its id.
A list of options is optional, so you can set for example the :prefix of the query, wich allows you to change between different tenants.
Usage example:
iex(1)> PaperTrail.VersionQueries.get_version(ModelName, id, [prefix: “tenant_id”])
Gets all the versions of a record.
get_versions(record :: Ecto.Schema.t, options :: []) :: Ecto.Query.t
get_versions(model :: module, id :: pos_integer) :: Ecto.Query.t
Gets all the versions of a record.
A list of options is optional, so you can set for example the :prefix of the query, wich allows you to change between different tenants.
Usage example:
iex(1)> PaperTrail.VersionQueries.get_versions(record, [prefix: “tenant_id”])
get_versions(model :: module, id :: pos_integer, options :: []) :: Ecto.Query.t
Gets all the versions of a record given a module and its id.
A list of options is optional, so you can set for example the :prefix of the query, wich allows you to change between different tenants.
Usage example:
iex(1)> PaperTrail.VersionQueries.get_versions(ModelName, id, [prefix: “tenant_id”])