Skip to content

Commit 500ce97

Browse files
committed
Revert "add validate section"
This reverts commit 6ccc4d1.
1 parent 6ccc4d1 commit 500ce97

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

guides/source/active_record_validations.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -932,27 +932,6 @@ See [`validates_uniqueness_of`][] for more information.
932932
[the PostgreSQL manual]:
933933
https://www.postgresql.org/docs/current/static/ddl-constraints.html
934934

935-
### `validate`
936-
937-
The `validate` validator is used with `belongs_to` and `has_one` associations to
938-
automatically validate the associated object whenever the parent object is
939-
saved. This option ensures that any new or updated associated objects are
940-
validated before the parent object can be successfully saved. By default, this
941-
option is set to `false`, meaning associated objects will not be automatically
942-
validated.
943-
944-
```ruby
945-
class Post < ApplicationRecord
946-
belongs_to :author, validate: true
947-
end
948-
```
949-
950-
In this example, every time a `Post` is saved, the associated `Author` will also
951-
be validated. If the `Author` is invalid, the `Post` will not be saved.
952-
953-
If you need to ensure that associated objects are validated every time the
954-
parent object is updated, consider using `validates_associated`.
955-
956935
### `validates_associated`
957936

958937
You should use this validator when your model has associations that always need to

0 commit comments

Comments
 (0)