From 8af1608752ffd6305e16137f480ee3e2f10fa630 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 27 May 2024 10:24:32 +0900 Subject: [PATCH 1/2] docs: make description more detailed --- user_guide_src/source/models/model.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/user_guide_src/source/models/model.rst b/user_guide_src/source/models/model.rst index edc4139a4d42..bf91f0a98ce3 100644 --- a/user_guide_src/source/models/model.rst +++ b/user_guide_src/source/models/model.rst @@ -659,9 +659,14 @@ prior to saving to the database with the ``insert()``, ``update()``, or ``save() .. important:: When you update data, by default, the validation in the model class only validates provided fields. This is to avoid validation errors when updating only some fields. - But this means ``required*`` rules do not work as expected when updating. - If you want to check required fields, you can change the behavior by configuration. - See :ref:`clean-validation-rules` for details. + However, this means that not all validation rules you set will be checked + during updates. Thus, incomplete data may pass the validation. + + For example, ``required*`` rules or ``is_unique`` rule that require the + values of other fields may not work as expected. + + To avoid such glitches, this behavior can be changed by configuration. See + :ref:`clean-validation-rules` for details. Setting Validation Rules ------------------------ From e19fc097b912afc4c389c4ba31b0a7ee74bd2fff Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 27 May 2024 10:25:14 +0900 Subject: [PATCH 2/2] docs: add link to section --- user_guide_src/source/models/model.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/models/model.rst b/user_guide_src/source/models/model.rst index bf91f0a98ce3..c77e68cb81b8 100644 --- a/user_guide_src/source/models/model.rst +++ b/user_guide_src/source/models/model.rst @@ -38,7 +38,7 @@ CodeIgniter does provide a model class that has a few nice features, including: - automatic database connection - basic CRUD methods -- in-model validation +- :ref:`in-model validation ` - :ref:`automatic pagination ` - and more