Skip to content

Commit bb672a5

Browse files
authored
Add a line about when/how validations happen to the moduledocs of Ecto.Changeset (#3763)
Fixes #3762
1 parent 11baa46 commit bb672a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ecto/changeset.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ defmodule Ecto.Changeset do
3434
The difference between them is that most validations can be
3535
executed without a need to interact with the database and, therefore,
3636
are always executed before attempting to insert or update the entry
37-
in the database. Some validations may happen against the database but
37+
in the database. Validations run immediately when a validation function
38+
is called on the data that is contained in the changeset at that time.
39+
40+
Some validations may happen against the database but
3841
they are inherently unsafe. Those validations start with a `unsafe_`
3942
prefix, such as `unsafe_validate_unique/3`.
4043

0 commit comments

Comments
 (0)