mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Specifiy association :validate option only applies to new associated objects
Per [code comments](6daa2d8315/activerecord/lib/active_record/associations.rb (L1418-L1420)
), the `:validate` option only makes a difference for *new* objects. Existing objects are not validated, regardless of the setting.
This commit is contained in:
parent
6daa2d8315
commit
345384fb1f
1 changed files with 3 additions and 3 deletions
|
@ -1092,7 +1092,7 @@ end
|
|||
|
||||
##### `:validate`
|
||||
|
||||
If you set the `:validate` option to `true`, then associated objects will be validated whenever you save this object. By default, this is `false`: associated objects will not be validated when this object is saved.
|
||||
If you set the `:validate` option to `true`, then new associated objects will be validated whenever you save this object. By default, this is `false`: new associated objects will not be validated when this object is saved.
|
||||
|
||||
##### `:optional`
|
||||
|
||||
|
@ -1412,7 +1412,7 @@ end
|
|||
|
||||
##### `:validate`
|
||||
|
||||
If you set the `:validate` option to `true`, then associated objects will be validated whenever you save this object. By default, this is `false`: associated objects will not be validated when this object is saved.
|
||||
If you set the `:validate` option to `true`, then new associated objects will be validated whenever you save this object. By default, this is `false`: new associated objects will not be validated when this object is saved.
|
||||
|
||||
#### Scopes for `has_one`
|
||||
|
||||
|
@ -1851,7 +1851,7 @@ The `:through` option specifies a join model through which to perform the query.
|
|||
|
||||
##### `:validate`
|
||||
|
||||
If you set the `:validate` option to `false`, then associated objects will not be validated whenever you save this object. By default, this is `true`: associated objects will be validated when this object is saved.
|
||||
If you set the `:validate` option to `false`, then new associated objects will not be validated whenever you save this object. By default, this is `true`: new associated objects will be validated when this object is saved.
|
||||
|
||||
#### Scopes for `has_many`
|
||||
|
||||
|
|
Loading…
Reference in a new issue