Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify validations that use validate_change internally #4509

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading