PaperTrail.Serializer (paper_trail v0.12.0) View Source
Serialization functions to create a version struct
Link to this section Summary
Functions
Adds a prefix to the Ecto schema
Returns the model type, which is the last module name
Returns the model primary id
Returns the last primary key value of a table
Creates a version struct for a model and a specific changeset action
Shows DB representation of an Ecto model, filters relationships and virtual attributes from an Ecto.Changeset or %ModelStruct{}
Dumps changes using Ecto fields
Link to this section Types
Link to this section Functions
Specs
add_prefix(Ecto.Schema.schema(), nil | String.t()) :: Ecto.Schema.schema()
Adds a prefix to the Ecto schema
Specs
Returns the model type, which is the last module name
Specs
get_model_id(model()) :: primary_key()
Returns the model primary id
Specs
get_sequence_id(model() | String.t()) :: primary_key()
Returns the last primary key value of a table
Specs
make_version_struct(map(), model(), options()) :: PaperTrail.Version.t()
Creates a version struct for a model and a specific changeset action
Specs
serialize(nil | Ecto.Changeset.t() | struct()) :: nil | map()
Shows DB representation of an Ecto model, filters relationships and virtual attributes from an Ecto.Changeset or %ModelStruct{}
Specs
serialize_changes(Ecto.Changeset.t()) :: map()
Dumps changes using Ecto fields