<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>test/database.yml</filename>
    </added>
    <added>
      <filename>test/model_test.rb</filename>
    </added>
    <added>
      <filename>test/rstakeout.rb</filename>
    </added>
    <added>
      <filename>test/schema.rb</filename>
    </added>
    <added>
      <filename>test/test_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -12,9 +12,6 @@ This plugin simplifies the parsing of qbXML messages into ActiveRecord model att
     &lt;CustomerRet&gt;
       &lt;ListID&gt;150000-933272658&lt;/ListID&gt;
       &lt;Name&gt;Abercrombie, Kristy&lt;/Name&gt;
-      &lt;FullName&gt;Abercrombie, Kristy&lt;/FullName&gt;
-      &lt;FirstName&gt;Kristy&lt;/FirstName&gt;
-      &lt;LastName&gt;Abercrombie&lt;/LastName&gt;`
       &lt;BillAddress&gt;
         &lt;Addr1&gt;Kristy Abercrombie&lt;/Addr1&gt;
         &lt;Addr2&gt;5647 Cypress Hill Rd&lt;/Addr2&gt;
@@ -22,14 +19,61 @@ This plugin simplifies the parsing of qbXML messages into ActiveRecord model att
         &lt;State&gt;CA&lt;/State&gt;
         &lt;PostalCode&gt;94326&lt;/PostalCode&gt;
       &lt;/BillAddress&gt;
-      &lt;Phone&gt;415-555-6579&lt;/Phone&gt;
-      &lt;Email&gt;kristy@samplename.com&lt;/Email&gt;
     &lt;/CustomerRet&gt;
     XML
     
     customer = Customer.new(:qbxml =&gt; xml)
     customer.list_id # =&gt; &quot;150000-933272658&quot;
     customer.name # =&gt; &quot;Abercrombie, Kristy&quot;
+    customer.bill_address_city # =&gt; &quot;Bayshore&quot;
+    ...
+    
+### Auto-builds has_many associations ###
+
+    class Invoice &lt; ActiveRecord::Base
+      acts_as_quickbooks_model
+      has_many :invoice_lines
+      has_many :invoice_line_groups
+    end
+    class InvoiceLine &lt; ActiveRecord::Base
+      acts_as_quickbooks_model
+      belongs_to :invoice
+    end
+    class InvoiceLineGroup &lt; ActiveRecord::Base
+      acts_as_quickbooks_model
+      belongs_to :invoice
+    end
+
+    xml = &lt;&lt;-XML
+    &lt;InvoiceRet&gt;
+      &lt;TxnID&gt;123&lt;/TxnID&gt;
+      &lt;InvoiceLineRet&gt;
+        &lt;TxnLineID&gt;456&lt;/TxnLineID&gt;
+        &lt;ItemRef&gt;
+          &lt;ListID&gt;789&lt;/ListID&gt;
+        &lt;/ItemRef&gt;
+      &lt;/InvoiceLineRet&gt;
+      &lt;InvoiceLineRet&gt;
+        &lt;TxnLineID&gt;012&lt;/TxnLineID&gt;
+        &lt;ItemRef&gt;
+          &lt;ListID&gt;567&lt;/ListID&gt;
+        &lt;/ItemRef&gt;
+      &lt;/InvoiceLineRet&gt;
+      &lt;InvoiceLineGroupRet&gt;
+        &lt;TxnLineID&gt;321&lt;/TxnLineID&gt;
+        &lt;ItemGroupRef&gt;
+          &lt;ListID&gt;987&lt;/ListID&gt;
+        &lt;/ItemGroupRef&gt;
+      &lt;/InvoiceLineGroupRet&gt;
+    &lt;/InvoiceRet&gt;
+    XML
+
+    invoice = Invoice.create(:qbxml =&gt; xml)
+    invoice.txn_id # =&gt; &quot;123&quot;
+    invoice.invoice_lines.count # =&gt; 2
+    invoice.invoice_line_groups.count # =&gt; 1
+    invoice.invoice_lines.first.txn_line_id # =&gt; &quot;456&quot;
+    invoice.invoice_line_groups.first.txn_line_id # =&gt; &quot;321&quot;
     ...
     
 ### References ###</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,16 @@ module ActsAsQuickbooksModel
       attributes_to_set.each do |a|
         self[a.to_sym] = hpricot_fetch(node, qbxml_model_map[a.to_sym])
       end
+      
+      # build has_many associations
+      has_many_associations = self.class.reflections.delete_if { |k,v| self.class.reflections[k].macro != :has_many }
+      has_many_associations.each do |k,v|
+        association_model = Inflector.camelize(Inflector.singularize(k))
+        element = association_model.to_s + 'Ret'
+        node.search(element).each do |association_node|
+          self.send(k).send(:build, :qbxml =&gt; association_node)
+        end
+      end
     end
     
     private</diff>
      <filename>lib/acts_as_quickbooks_model.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2ca4362a38493591ab24142563d32d713fc957af</id>
    </parent>
  </parents>
  <author>
    <name>Zack Chandler</name>
    <email>zackchandler@depixelate.com</email>
  </author>
  <url>http://github.com/zackchandler/acts_as_quickbooks_model/commit/82538487d393dd665bbab9ad62d0a936a3e4d889</url>
  <id>82538487d393dd665bbab9ad62d0a936a3e4d889</id>
  <committed-date>2008-05-17T12:36:03-07:00</committed-date>
  <authored-date>2008-05-17T12:36:03-07:00</authored-date>
  <message>tests, auto-build has_many associations</message>
  <tree>34e0eca9e71253d4ac104a30689b91c680da87c6</tree>
  <committer>
    <name>Zack Chandler</name>
    <email>zackchandler@depixelate.com</email>
  </committer>
</commit>
