Ecto.Validator.Predicates.has_length/4

Parsed documentation:
View on GitHub
Validates the attribute has a given length according to Unicode
(i.e. it uses `String.length` under the scenes). That said, this
function should not be used to validate binary fields.

The length can be given as a range (indicating min and max),
as an integer (indicating exact match) or as keyword options,
indicating, min and max values.

Raises if the given argument is not a binary.

## Options

* `:too_long`  - message when the length is too long
                 (defaults to "is too long (maximum is X characters)")
* `:too_short` - message when the length is too short
                 (defaults to "is too short (minimum is X characters)")
* `:no_match` - message when the length does not match
                (defaults to "must be X characters")

## Examples

    validate user,
      password: has_length(6..100)

    validate user,
      password: has_length(min: 6, too_short: "requires a minimum length")

    validate user,
      code: has_length(3, no_match: "needs to be 3 characters")
Suggestions:
Please help! Open an issue on GitHub if this assessment is incorrect.