Update 'Building Complex Forms' with `inverse_of`

If the example for complex forms is implemented, ActiveRecord will prevent saving unless `inverse_of: :person` is added to the `has_many :addresses` association.
This commit is contained in:
marksiemers 2017-03-15 12:38:49 -07:00 committed by GitHub
parent bd3f0e706c
commit dcd6ceb0c9
1 changed files with 1 additions and 1 deletions

View File

@ -877,7 +877,7 @@ Active Record provides model level support via the `accepts_nested_attributes_fo
```ruby
class Person < ApplicationRecord
has_many :addresses
has_many :addresses, inverse_of: :person
accepts_nested_attributes_for :addresses
end