• M
    Describe how has_many's :dependent option affects #delete · 39806b6d
    Marcel M. Cary 提交于
    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]
    39806b6d
association_basics.md 83.1 KB