<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -35,6 +35,11 @@ module CompositePrimaryKeys
         def composite?
           false
         end
+
+        def set_auto_increment_column(column)
+          cattr_accessor :auto_increment_column
+          self.auto_increment_column = column
+        end
       end
 
       module InstanceMethods
@@ -103,14 +108,12 @@ module CompositePrimaryKeys
           quoted_pk_columns = self.class.primary_key.map { |col| connection.quote_column_name(col) }
           cols = quoted_column_names(attributes_minus_pks) &lt;&lt; quoted_pk_columns
           vals = attributes_minus_pks.values &lt;&lt; quoted_id
-          connection.insert(
-            &quot;INSERT INTO #{self.class.quoted_table_name} &quot; +
-            &quot;(#{cols.join(', ')}) &quot; +
-            &quot;VALUES (#{vals.join(', ')})&quot;,
-            &quot;#{self.class.name} Create&quot;,
-            self.class.primary_key,
-            self.id
-          )
+          send(&quot;#{self.class.auto_increment_column}=&quot;,
+               connection.insert(&quot;INSERT INTO #{self.class.quoted_table_name} &quot; \
+                                 &quot;(#{cols.join(', ')}) &quot; \
+                                 &quot;VALUES (#{vals.join(', ')})&quot;,
+                                 &quot;#{self.class.name} Create&quot;))
+
           @new_record = false
           return true
         end</diff>
      <filename>lib/composite_primary_keys/base.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0efff84e20d818323162859687e4011c2e941856</id>
    </parent>
  </parents>
  <author>
    <name>Tyler McMullen</name>
    <email>tyler@scribd.com</email>
  </author>
  <url>http://github.com/tyler/composite_primary_keys/commit/94f8b5eed7db4484d0e3cf8f260d8fa456118e76</url>
  <id>94f8b5eed7db4484d0e3cf8f260d8fa456118e76</id>
  <committed-date>2009-05-11T18:34:34-07:00</committed-date>
  <authored-date>2009-05-11T18:34:34-07:00</authored-date>
  <message>Add set_auto_increment_field so we can update the object's auto-incremented field when inserting.</message>
  <tree>ee4b9daf1d3a2e06d9acc9658ff643cf1fca54f2</tree>
  <committer>
    <name>Tyler McMullen</name>
    <email>tyler@scribd.com</email>
  </committer>
</commit>
