From 53db086e6082b5fb277e4a497f6d11a616a778c8 Mon Sep 17 00:00:00 2001 From: Sammy Larbi Date: Mon, 28 Mar 2016 09:03:02 -0500 Subject: Update how to clear the association cache Passing `true` to the association has been deprecated. --- guides/source/association_basics.md | 4 ++-- 1 file 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 ``` -- cgit v1.2.3