Skip to content

Commit cc33865

Browse files
authored
Merge pull request #8917 from kenjis/docs-model-validation-note
docs: improve Note for in-Model Validation
2 parents 117dc1d + e19fc09 commit cc33865

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

user_guide_src/source/models/model.rst

+9-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CodeIgniter does provide a model class that has a few nice features, including:
3838

3939
- automatic database connection
4040
- basic CRUD methods
41-
- in-model validation
41+
- :ref:`in-model validation <in-model-validation>`
4242
- :ref:`automatic pagination <paginating-with-models>`
4343
- and more
4444

@@ -659,9 +659,14 @@ prior to saving to the database with the ``insert()``, ``update()``, or ``save()
659659
.. important:: When you update data, by default, the validation in the model class only
660660
validates provided fields. This is to avoid validation errors when updating only some fields.
661661

662-
But this means ``required*`` rules do not work as expected when updating.
663-
If you want to check required fields, you can change the behavior by configuration.
664-
See :ref:`clean-validation-rules` for details.
662+
However, this means that not all validation rules you set will be checked
663+
during updates. Thus, incomplete data may pass the validation.
664+
665+
For example, ``required*`` rules or ``is_unique`` rule that require the
666+
values of other fields may not work as expected.
667+
668+
To avoid such glitches, this behavior can be changed by configuration. See
669+
:ref:`clean-validation-rules` for details.
665670

666671
Setting Validation Rules
667672
------------------------

0 commit comments

Comments
 (0)