Rivet.Utils.Ecto.Changeset (rivet_utils v2.0.8)
View Sourceextensions for ecto change sets
Contributor: Brandon Gillespie
Summary
Functions
If the key exists in the changeset, make sure it's a clean value
For a value that is a list of maps, validate each element with func
Convert keys map to atoms
(replacement for validate_format, which supports negation)
free-form updating, like a map
Functions
If the key exists in the changeset, make sure it's a clean value
For a value that is a list of maps, validate each element with func
Convert keys map to atoms
(replacement for validate_format, which supports negation)
Validates a change has the given format.
The format has to be expressed as a regular expression.
Options
:message
- the message on failure, defaults to "has invalid format":not
- invert match for truth. default is false
Examples
validate_rex(changeset, :email, ~r/@/)
validate_rex(changeset, :thing, ~r/[^a-z0-9]/, not: true)
free-form updating, like a map