View Source MalanPhoenixUtils.Ecto.Changeset (malan_phoenix_utils v0.1.0)

Link to this section Summary

Functions

If any of the top-level keys in data are Ecto.Changesets, apply their changes.

Convert changeset errors into a String

Convert changeset errors into a list of Strings

Validates that the property specified does NOT match the provided regex.

Link to this section Functions

If any of the top-level keys in data are Ecto.Changesets, apply their changes.

This is not recursive. It onliy does the top level. Also changes are applied whether they are valid or not, so consider whether that's the behavior you want.

Link to this function

convert_changes(data, struct_type)

View Source
Link to this function

errors_to_str(changeset)

View Source

Convert changeset errors into a String

examples

Examples

MalanPhoenixUtils.Ecto.Changeset.errors_to_str_list(changeset)
# TODO example needs updated
[who: {"who must be a valid ID of a user", []}]
Link to this function

errors_to_str_list(errors)

View Source

Convert changeset errors into a list of Strings

examples

Examples

MalanPhoenixUtils.Ecto.Changeset.errors_to_str_list(changeset)
# TODO example needs updated
[who: {"who must be a valid ID of a user", []}]
Link to this function

validate_ip_addr(changeset, property, allow_empty? \\ false)

View Source
Link to this function

validate_not_format(value, regex)

View Source

Validates that the property specified does NOT match the provided regex.

This function is essentially the opposite of validate_format()

Link to this function

validate_not_format(changeset, property, regex)

View Source