<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -31,7 +31,9 @@ module ActsAsQuickbooksModel
       # set qbxml attributes that exist in map and model
       model_qbxml_attributes = []
       qbxml_model_map.keys.each do |key|
-        model_qbxml_attributes &lt;&lt; key if self.respond_to?(&quot;#{key}=&quot;)
+        if self.respond_to?(&quot;#{key}=&quot;) &amp;&amp; self.class.reflections[key.to_sym].nil?
+          model_qbxml_attributes &lt;&lt; key
+        end
       end
       node = xml.respond_to?('innerHTML') ? xml : Hpricot.XML(xml).root
       </diff>
      <filename>lib/acts_as_quickbooks_model.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,13 @@ require File.dirname(__FILE__) + '/test_helper'
 
 class Customer &lt; ActiveRecord::Base
   acts_as_quickbooks_model
+  has_many :notes
   alias_attribute :is_active, :active
 end
+class Note &lt; ActiveRecord::Base
+  belongs_to :customer
+end
+
 class Payment &lt; ActiveRecord::Base
   acts_as_quickbooks_model 'ReceivePayment'
 end
@@ -43,6 +48,7 @@ CUSTOMER_RET = &lt;&lt;-XML
   &lt;ParentRef&gt;
     &lt;ListID&gt;456&lt;/ListID&gt;
   &lt;/ParentRef&gt;
+  &lt;Notes&gt;foo bar&lt;/Notes&gt;
 &lt;/CustomerRet&gt;
 XML
 
@@ -195,4 +201,11 @@ context 'A model using acts_as_quickbooks_model' do
     other_charge_product.list_id.should.equal '345'
     other_charge_product.special_item_type.should.equal 'foo'
   end
+
+  specify 'should not attempt to assign a has_many if an identical node appears as a QB element' do
+    # Example: Customer has_many notes
+    # CustomerRet sends back &lt;Notes&gt; node
+    customer = Customer.create!(:qbxml =&gt; CUSTOMER_RET)
+    customer.notes.should.be.empty
+  end
 end
\ No newline at end of file</diff>
      <filename>test/model_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,12 @@ ActiveRecord::Schema.define(:version =&gt; 1) do
     t.string :foo
   end
 
+  create_table :notes, :force =&gt; true do |t|
+    t.integer :id
+    t.integer :customer_id
+    t.string :note
+  end
+  
   create_table :invoices, :force =&gt; true do |t|
     t.integer :id
     t.string :txn_id</diff>
      <filename>test/schema.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6ec30a0bf39b4f68bf97f9ec49099b4ed33dd2a5</id>
    </parent>
  </parents>
  <author>
    <name>Zack Chandler</name>
    <email>zackchandler@depixelate.com</email>
  </author>
  <url>http://github.com/zackchandler/acts_as_quickbooks_model/commit/9872b6d2a1db36fd9618cb09e695ff852a17647c</url>
  <id>9872b6d2a1db36fd9618cb09e695ff852a17647c</id>
  <committed-date>2009-01-05T14:04:32-08:00</committed-date>
  <authored-date>2009-01-05T14:04:32-08:00</authored-date>
  <message>don't inadvertently set has_many model if it's signature matches an element in returned QBXML</message>
  <tree>8375ba994fae0c1fb380d461b93ab6850b47bb4d</tree>
  <committer>
    <name>Zack Chandler</name>
    <email>zackchandler@depixelate.com</email>
  </committer>
</commit>
