Added documentation and changed import to not only allow 'validate' function

This commit is contained in:
Alex Tavarez
2025-07-25 12:25:04 -04:00
parent 75b43eb20a
commit f812711d9d

View File

@@ -1,7 +1,15 @@
defmodule Sukaato.CustomValidators do
import Ecto.Changeset
import Validate, only: [validate: 2]
import Validate
@moduledoc """
Provide a collecton of custom validation functions for Ecto database
database table update validation.
"""
@doc """
Validate a map or array/list column for an Ecto database table update.
"""
def validate_map_format(changeset, field, conventional_mapping) when is_atom(field) do
field_value = get_field(changeset, field)
validation_result = validate(field_value, conventional_mapping)