aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-09-21 20:49:56 -0500
committerFrancesco Rodriguez <lrodriguezsanc@gmail.com>2012-09-21 20:49:56 -0500
commit08035482858a56963c7694bc7b92308f59272b28 (patch)
treea75414b0b539e60878e6141ccc359f494a98d7fa /activerecord/lib/active_record
parentfa9424695644c12efeb8413511eea4f55b3bb22c (diff)
downloadrails-08035482858a56963c7694bc7b92308f59272b28.tar.gz
rails-08035482858a56963c7694bc7b92308f59272b28.tar.bz2
rails-08035482858a56963c7694bc7b92308f59272b28.zip
update AR::Associations::CollectionProxy#loaded? documentation [ci skip]
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/collection_proxy.rb7
1 files changed, 6 insertions, 1 deletions
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