From 08035482858a56963c7694bc7b92308f59272b28 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Fri, 21 Sep 2012 20:49:56 -0500 Subject: update AR::Associations::CollectionProxy#loaded? documentation [ci skip] --- activerecord/lib/active_record/associations/collection_proxy.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index c113957faa..cd3cb1fba0 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -42,6 +42,11 @@ module ActiveRecord @association.load_target end + # Returns +true+ if the association has been loaded, otherwise +false+. + # + # person.pets.loaded? # => false + # person.pets + # person.pets.loaded? # => true def loaded? @association.loaded? end @@ -889,7 +894,7 @@ module ActiveRecord end # Returns a new array of objects from the collection. If the collection - # hasn't been loaded, it fetches the records from the database. + # hasn't been loaded, it fetches the records from the database. # # class Person < ActiveRecord::Base # has_many :pets -- cgit v1.2.3