1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #39681 from JuarezLustosa/doc/active_record_validations

[ci skip] Increase info on validate presence for association
This commit is contained in:
Vipul A M 2020-06-21 17:04:06 +05:30 committed by GitHub
commit d6fda8e019
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -534,6 +534,8 @@ end
In order to validate associated records whose presence is required, you must
specify the `:inverse_of` option for the association:
NOTE: If you want to ensure that the association it is both present and valid, you also need to use `validates_associated`.
```ruby
class Order < ApplicationRecord
has_many :line_items, inverse_of: :order