aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorAna María Martínez Gómez <ammartinez@suse.de>2018-11-09 15:09:24 +0100
committerAna María Martínez Gómez <ammartinez@suse.de>2018-11-09 15:15:09 +0100
commite53d2325d52f42c4646696a4db7af472c3a1ec7b (patch)
tree67b1bc444209a436880e88dab543517b80a63219 /guides
parentb9807eb53880a386890aa1919cf812fb9876b805 (diff)
downloadrails-e53d2325d52f42c4646696a4db7af472c3a1ec7b.tar.gz
rails-e53d2325d52f42c4646696a4db7af472c3a1ec7b.tar.bz2
rails-e53d2325d52f42c4646696a4db7af472c3a1ec7b.zip
Clarify the validation of present associations
I think that it is not clear what means that _an association is present_. Add that it is checking that the foreign key is not empty and that the referenced object exists to clarify it.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_record_validations.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md
index afe837a97c..25f6f7bd2c 100644
--- a/guides/source/active_record_validations.md
+++ b/guides/source/active_record_validations.md
@@ -538,7 +538,8 @@ end
If you want to be sure that an association is present, you'll need to test
whether the associated object itself is present, and not the foreign key used
-to map the association.
+to map the association. This way, it is not only checked that the foreign key
+is not empty but also that the referenced object exists.
```ruby
class LineItem < ApplicationRecord