Permalink
Browse files

update AR::Associations::CollectionProxy#loaded? documentation [ci skip]

  • Loading branch information...
1 parent fa94246 commit 08035482858a56963c7694bc7b92308f59272b28 Francesco Rodriguez committed Sep 22, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 activerecord/lib/active_record/associations/collection_proxy.rb
@@ -42,6 +42,11 @@ def load_target
@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 @@ def ==(other)
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

0 comments on commit 0803548

Please sign in to comment.