PaperTrail.Serializer (paper_trail v0.10.1)
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
model()
Specs
model() :: struct() | Ecto.Changeset.t()
options()
Specs
options() :: Keyword.t()
primary_key()
Specs
Link to this section Functions
add_prefix(schema, prefix)
Specs
add_prefix(Ecto.Schema.schema(), nil | String.t()) :: Ecto.Schema.schema()
Adds a prefix to the Ecto schema
get_item_type(arg1)
Specs
Returns the model type, which is the last module name
get_model_id(model)
Specs
get_model_id(model()) :: primary_key()
Returns the model primary id
get_sequence_id(table_name)
Specs
get_sequence_id(model() | String.t()) :: primary_key()
Returns the last primary key value of a table
make_version_struct(map, model, options)
Specs
make_version_struct(map(), model(), options()) :: PaperTrail.Version.t()
Creates a version struct for a model and a specific changeset action
serialize(model)
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{}
serialize_changes(changeset)
Specs
serialize_changes(Ecto.Changeset.t()) :: map()
Dumps changes using Ecto fields