<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1307,7 +1307,7 @@ module ActiveRecord
             if send(reflection.name).loaded?
               send(reflection.name).map(&amp;:id)
             else
-              send(reflection.name).all(:select =&gt; &quot;#{reflection.quoted_table_name}.id&quot;).map(&amp;:id)
+              send(reflection.name).all(:select =&gt; &quot;#{reflection.quoted_table_name}.#{reflection.klass.primary_key}&quot;).map(&amp;:id)
             end
           end
         end</diff>
      <filename>activerecord/lib/active_record/associations.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>367a55e1b8deb87e7388cb97b2ac8c28a0796c89</id>
    </parent>
  </parents>
  <author>
    <name>miloops</name>
    <email>miloops@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/6183e55f714b436335dc843528be7525c342d922</url>
  <id>6183e55f714b436335dc843528be7525c342d922</id>
  <committed-date>2008-08-30T17:39:30-07:00</committed-date>
  <authored-date>2008-08-30T17:13:53-07:00</authored-date>
  <message>Use reflection primary_key instead of id for when selecting association ids.

[#906 state:resolved]

Signed-off-by: Jeremy Kemper &lt;jeremy@bitsweat.net&gt;</message>
  <tree>8b8dce772a15b3be083daa5a258a622b1e861262</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
