<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,8 +1,13 @@
 Autotest.add_hook :initialize do |at|
+  at.add_mapping(%r{^lib/\w.*\.rb}) do
+    at.files_matching(%r{^test/*/\w.*_test\.rb})
+  end
+
   at.add_mapping(%r{^test/rails_root/\w.*}) do
     at.files_matching(%r{^test/*/\w.*_test\.rb})
   end
 
   at.add_exception(%r{.svn})
   at.add_exception(%r{.log$})
+  at.add_exception(%r{^.autotest$})
 end</diff>
      <filename>.autotest</filename>
    </modified>
    <modified>
      <diff>@@ -302,7 +302,7 @@ module ThoughtBot # :nodoc:
               elsif reflection.options[:as]
                 fk = reflection.options[:as].to_s.foreign_key
               else
-                fk = klass.name.foreign_key
+                fk = reflection.primary_key_name
               end
               associated_klass = (reflection.options[:class_name] || association.to_s.classify).constantize
               assert associated_klass.column_names.include?(fk.to_s), &quot;#{associated_klass.name} does not have a #{fk} foreign key.&quot;
@@ -367,7 +367,7 @@ module ThoughtBot # :nodoc:
 
             unless reflection.options[:polymorphic]
               associated_klass = (reflection.options[:class_name] || association.to_s.classify).constantize
-              fk = reflection.options[:foreign_key] || associated_klass.name.foreign_key
+              fk = reflection.options[:foreign_key] || reflection.primary_key_name
               assert klass.column_names.include?(fk.to_s), &quot;#{klass.name} does not have a #{fk} foreign key.&quot;
             end
           end</diff>
      <filename>lib/shoulda/active_record_helpers.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>46f8ff243700e15bc6c4b1b08a4494ba7c9559c9</id>
    </parent>
  </parents>
  <author>
    <name>tsaleh</name>
    <email>tsaleh@7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa</email>
  </author>
  <url>http://github.com/snowblink/shoulda/commit/b5251e9f2b641c75de16c04e732ee00791672ace</url>
  <id>b5251e9f2b641c75de16c04e732ee00791672ace</id>
  <committed-date>2008-01-21T06:30:10-08:00</committed-date>
  <authored-date>2008-01-21T06:30:10-08:00</authored-date>
  <message>fixed foreign key determination (http://tammer.lighthouseapp.com/projects/5807/tickets/8)

git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@287 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa</message>
  <tree>7660d72e85839c0041e14a76aba0e30379c11334</tree>
  <committer>
    <name>tsaleh</name>
    <email>tsaleh@7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa</email>
  </committer>
</commit>
