View Source PaperTrail.Serializer (paper_trail v1.1.2)
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
@spec add_prefix(Ecto.Schema.schema(), nil | String.t()) :: Ecto.Schema.schema()
Adds a prefix to the Ecto schema
Returns the model type, which is the last module name
@spec get_model_id(model()) :: primary_key()
Returns the model primary id
@spec get_sequence_id(model() | String.t()) :: primary_key()
Returns the last primary key value of a table
@spec make_version_struct(map(), model(), options()) :: PaperTrail.Version.t()
Creates a version struct for a model and a specific changeset action
@spec 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{}
@spec serialize_changes(Ecto.Changeset.t()) :: map()
Dumps changes using Ecto fields