Skip to content

Commit

Permalink
Clarify validations that use validate_change internally (#4509)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach authored Sep 13, 2024
1 parent 4e3db57 commit b4ad5fc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/ecto/changeset.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2827,6 +2827,9 @@ defmodule Ecto.Changeset do
The format has to be expressed as a regular expression.
The validation only runs if a change for the given `field` exists and the
change value is not `nil`.
## Options
* `:message` - the message on failure, defaults to "has invalid format".
Expand Down Expand Up @@ -2855,6 +2858,9 @@ defmodule Ecto.Changeset do
@doc """
Validates a change is included in the given enumerable.
The validation only runs if a change for the given `field` exists and the
change value is not `nil`.
## Options
* `:message` - the message on failure, defaults to "is invalid".
Expand Down Expand Up @@ -2887,6 +2893,9 @@ defmodule Ecto.Changeset do
Type of the field must be array.
The validation only runs if a change for the given `field` exists and the
change value is not `nil`.
## Options
* `:message` - the message on failure, defaults to "has an invalid entry".
Expand Down Expand Up @@ -2926,6 +2935,9 @@ defmodule Ecto.Changeset do
@doc """
Validates a change is not included in the given enumerable.
The validation only runs if a change for the given `field` exists and the
change value is not `nil`.
## Options
* `:message` - the message on failure, defaults to "is reserved".
Expand Down Expand Up @@ -2957,6 +2969,9 @@ defmodule Ecto.Changeset do
of unicode characters. Then consider using the `:count` option to
limit the number of codepoints (`:codepoints`), or limit the number of bytes (`:bytes`).
The validation only runs if a change for the given `field` exists and the
change value is not `nil`.
## Options
* `:is` - the length must be exactly this value
Expand Down Expand Up @@ -3153,6 +3168,9 @@ defmodule Ecto.Changeset do
@doc """
Validates the properties of a number.
The validation only runs if a change for the given `field` exists and the
change value is not `nil`.
## Options
* `:less_than`
Expand Down

0 comments on commit b4ad5fc

Please sign in to comment.