aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@gmail.com>2015-11-06 16:40:16 -0500
committerEileen M. Uchitelle <eileencodes@gmail.com>2015-11-06 16:40:16 -0500
commit79d310fbd33c172f7f54d989191008581e028b64 (patch)
tree736eb1ff69e21dc59fe1ae6a3d39215d29989bfb /guides
parentf036eacd6c9150e20e262568f9ee9897a8bad74f (diff)
parent0aea9289f215d62d6b5e84557954c1136a6a1720 (diff)
downloadrails-79d310fbd33c172f7f54d989191008581e028b64.tar.gz
rails-79d310fbd33c172f7f54d989191008581e028b64.tar.bz2
rails-79d310fbd33c172f7f54d989191008581e028b64.zip
Merge pull request #22203 from cllns/guides-has-many-through-join-models
Clarify automatic creation/deletion of join models for has_many through
Diffstat (limited to 'guides')
-rw-r--r--guides/source/association_basics.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md
index 996050d667..c272daac28 100644
--- a/guides/source/association_basics.md
+++ b/guides/source/association_basics.md
@@ -240,13 +240,15 @@ class CreateAppointments < ActiveRecord::Migration
end
```
-The collection of join models can be managed via the API. For example, if you assign
+The collection of join models can be managed via the [`has_many` association methods](#has-many-association-reference).
+For example, if you assign:
```ruby
physician.patients = patients
```
-new join models are created for newly associated objects, and if some are gone their rows are deleted.
+Then new join models are automatically created for the newly associated objects.
+If some that existed previously are now missing, then their join rows are automatically deleted.
WARNING: Automatic deletion of join models is direct, no destroy callbacks are triggered.