diff options
author | Marcel M. Cary <marcel@oak.homeunix.org> | 2018-11-13 15:29:43 -0800 |
---|---|---|
committer | Marcel M. Cary <marcel@oak.homeunix.org> | 2018-11-13 16:06:00 -0800 |
commit | 39806b6d98c1dbcbaac6748274e2cc3fbfba3495 (patch) | |
tree | 38c92dff90c53b009003aba16aefd82ec2c38b6b /package.json | |
parent | 3dea7f0615144e891d4122697638db735fbea71d (diff) | |
download | rails-39806b6d98c1dbcbaac6748274e2cc3fbfba3495.tar.gz rails-39806b6d98c1dbcbaac6748274e2cc3fbfba3495.tar.bz2 rails-39806b6d98c1dbcbaac6748274e2cc3fbfba3495.zip |
Describe how has_many's :dependent option affects #delete
I was puzzled about why `collection=` was destroying the removed
records on an association with `dependent: :destroy`, even after
consulting the documentation for that option. I had to dive into the
Active Record source to understand what was going on: eventually
`collection=` calls `collection.delete` on the ousted records, and it
also uses the `:dependent` option to decide how to remove records.
It would have helped me to have mention of this in the documentation for
`:dependent`, not just under `collection.delete` (which I found much
later).
Briefly mention the broader impacts of `:dependent` in the Association
Basics guide.
[ci skip]
Diffstat (limited to 'package.json')
0 files changed, 0 insertions, 0 deletions