From 158a71b2cbd6be9ef9c88282b48a3e39e47908ed Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Mon, 21 May 2012 12:19:34 -0500 Subject: add CollectionProxy#reload documentation --- .../lib/active_record/associations/collection_proxy.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index e3ebe03121..80a1715ee2 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -516,6 +516,24 @@ module ActiveRecord self end + # Reloads the collection from the database. Returns +self+. + # Equivalent to +collection(true)+. + # + # class Person < ActiveRecord::Base + # has_many :pets + # end + # + # person.pets # fetches pets from the database + # # => [#] + # + # person.pets # uses the pets cache + # # => [#] + # + # person.pets.reload # fetches pets from the database + # # => [#] + # + # person.pets(true)  # fetches pets from the database + # # => [#] def reload proxy_association.reload self -- cgit v1.2.3