View Source Flint.Changeset (Flint v0.4.0)

The base changeset function defined by Flint. Flint.Changeset uses the module attributes that are collected when using the Flint.Schema macros to perform transformations and validations.

Summary

Functions

Given a Flint (or Ecto) schema and params (can be a map, struct of the given schema, or an existing changeset), applies all steps of the Flint.Changeset to generate a new changeset.

Uses the quoted expressions from the Flint.Schema.field and Flint.Schema.field! do blocks to validate the changeset.

Functions

Link to this function

changeset(schema, params \\ %{}, bindings \\ [])

View Source

Given a Flint (or Ecto) schema and params (can be a map, struct of the given schema, or an existing changeset), applies all steps of the Flint.Changeset to generate a new changeset.

This function casts all fields (recursively casting all embeds using this same function), validates required fields (specified using the bang (!) macros exposed by Flint), outputting the resulting Ecto.Changeset.

Link to this function

validate_do_blocks(changeset, bindings \\ [])

View Source

Uses the quoted expressions from the Flint.Schema.field and Flint.Schema.field! do blocks to validate the changeset.

You can optionally pass bindings to be added to the evaluation context.