<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,9 @@
 module ActiveRecord
   module Associations
+    # This is the proxy that handles a has many association.
+    #
+    # If the association has a &lt;tt&gt;:through&lt;/tt&gt; option further specialization
+    # is provided by its child HasManyThroughAssociation.
     class HasManyAssociation &lt; AssociationCollection #:nodoc:
       # Count the number of associated records. All arguments are optional.
       def count(*args)
@@ -27,6 +31,16 @@ module ActiveRecord
           end
         end
 
+        # Returns the number of records in this collection.
+        #
+        # If the association has a counter cache it gets that value. Otherwise
+        # a count via SQL is performed, bounded to &lt;tt&gt;:limit&lt;/tt&gt; if there's one.
+        # That does not depend on whether the collection has already been loaded
+        # or not. The +size+ method is the one that takes the loaded flag into
+        # account and delegates to +count_records+ if needed.
+        #
+        # If the collection is empty the target is set to an empty array and
+        # the loaded flag is set to true as well.
         def count_records
           count = if has_cached_counter?
             @owner.send(:read_attribute, cached_counter_attribute_name)</diff>
      <filename>activerecord/lib/active_record/associations/has_many_association.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>48f56bf2beace63a20b0def4176274804e088c55</id>
    </parent>
  </parents>
  <author>
    <name>Xavier Noria</name>
    <email>fxn@hashref.com</email>
  </author>
  <url>http://github.com/lifo/docrails/commit/2ee60b0f70febc8c28a90e8361d9e9c2b86d4833</url>
  <id>2ee60b0f70febc8c28a90e8361d9e9c2b86d4833</id>
  <committed-date>2008-08-18T17:51:37-07:00</committed-date>
  <authored-date>2008-08-18T17:51:37-07:00</authored-date>
  <message>added a class rdoc and documented count_records in has_many_association.rb</message>
  <tree>9e6075b3d3fc3131808415d689bb6bfff04e9a6b</tree>
  <committer>
    <name>Xavier Noria</name>
    <email>fxn@hashref.com</email>
  </committer>
</commit>
