diff options
author | Sammy Larbi <sam@codeodor.com> | 2016-03-28 09:03:02 -0500 |
---|---|---|
committer | Sammy Larbi <sam@codeodor.com> | 2016-03-28 09:03:02 -0500 |
commit | 53db086e6082b5fb277e4a497f6d11a616a778c8 (patch) | |
tree | 69f67af744075d03330fa716551c9002fcb53004 /guides/source | |
parent | 475109c517e724c015ee13061416568a7d6b9757 (diff) | |
download | rails-53db086e6082b5fb277e4a497f6d11a616a778c8.tar.gz rails-53db086e6082b5fb277e4a497f6d11a616a778c8.tar.bz2 rails-53db086e6082b5fb277e4a497f6d11a616a778c8.zip |
Update how to clear the association cache
Passing `true` to the association has been deprecated.
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/association_basics.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index 67fd758fe1..4977d4f30e 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -545,12 +545,12 @@ author.books.size # uses the cached copy of books author.books.empty? # uses the cached copy of books ``` -But what if you want to reload the cache, because data might have been changed by some other part of the application? Just pass `true` to the association call: +But what if you want to reload the cache, because data might have been changed by some other part of the application? Just call `reload` on the association: ```ruby author.books # retrieves books from the database author.books.size # uses the cached copy of books -author.books(true).empty? # discards the cached copy of books +author.books.reload.empty? # discards the cached copy of books # and goes back to the database ``` |