From f2810f1dab649b2999fa0ad991ddabb416c5be74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julia=20Lo=CC=81pez?= Date: Mon, 7 Aug 2017 16:49:00 -0400 Subject: add reload_association to documentation [ci skip] --- guides/source/association_basics.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'guides') diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index bead931529..44228de591 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -811,6 +811,7 @@ When you declare a `belongs_to` association, the declaring class automatically g * `build_association(attributes = {})` * `create_association(attributes = {})` * `create_association!(attributes = {})` +* `reload_association` In all of these methods, `association` is replaced with the symbol passed as the first argument to `belongs_to`. For example, given the declaration: @@ -840,10 +841,10 @@ The `association` method returns the associated object, if any. If no associated @author = @book.author ``` -If the associated object has already been retrieved from the database for this object, the cached version will be returned. To override this behavior (and force a database read), call `#reload` on the parent object. +If the associated object has already been retrieved from the database for this object, the cached version will be returned. To override this behavior (and force a database read), call `#reload_association` on the parent object. ```ruby -@author = @book.reload.author +@author = @book.reload_author ``` ##### `association=(associate)` @@ -1161,6 +1162,7 @@ When you declare a `has_one` association, the declaring class automatically gain * `build_association(attributes = {})` * `create_association(attributes = {})` * `create_association!(attributes = {})` +* `reload_association` In all of these methods, `association` is replaced with the symbol passed as the first argument to `has_one`. For example, given the declaration: @@ -1190,10 +1192,10 @@ The `association` method returns the associated object, if any. If no associated @account = @supplier.account ``` -If the associated object has already been retrieved from the database for this object, the cached version will be returned. To override this behavior (and force a database read), call `#reload` on the parent object. +If the associated object has already been retrieved from the database for this object, the cached version will be returned. To override this behavior (and force a database read), call `#reload_association` on the parent object. ```ruby -@account = @supplier.reload.account +@account = @supplier.reload_account ``` ##### `association=(associate)` -- cgit v1.2.3