aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/association_basics.md
diff options
context:
space:
mode:
authorWillian Gustavo Veiga <beberveiga@gmail.com>2018-10-22 20:06:45 -0300
committerWillian Gustavo Veiga <beberveiga@gmail.com>2018-10-22 20:06:45 -0300
commit47ef6fd2ca596a7d47bac6b584d5eced46e0d4d8 (patch)
tree26d0a84a3cefd153b5315c37addb784e1b9228f3 /guides/source/association_basics.md
parentc8ff9bd63a2371b6f0f0b4f48abf29cf89a1d397 (diff)
parente853acb9b4cfb5bb91a241cf37084631cd145823 (diff)
downloadrails-47ef6fd2ca596a7d47bac6b584d5eced46e0d4d8.tar.gz
rails-47ef6fd2ca596a7d47bac6b584d5eced46e0d4d8.tar.bz2
rails-47ef6fd2ca596a7d47bac6b584d5eced46e0d4d8.zip
Merge branch 'master' into feature/reselect-method
Diffstat (limited to 'guides/source/association_basics.md')
-rw-r--r--guides/source/association_basics.md5
1 files changed, 2 insertions, 3 deletions
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md
index b0a905c754..78a1f47407 100644
--- a/guides/source/association_basics.md
+++ b/guides/source/association_basics.md
@@ -868,7 +868,7 @@ While Rails uses intelligent defaults that will work well in most situations, th
```ruby
class Book < ApplicationRecord
- belongs_to :author, dependent: :destroy,
+ belongs_to :author, touch: :books_updated_at,
counter_cache: true
end
```
@@ -1048,8 +1048,7 @@ There may be times when you wish to customize the query used by `belongs_to`. Su
```ruby
class Book < ApplicationRecord
- belongs_to :author, -> { where active: true },
- dependent: :destroy
+ belongs_to :author, -> { where active: true }
end
```