From 1f7c3d02645c6b72e5d1428bc7da6668cdee5fa8 Mon Sep 17 00:00:00 2001
From: Marian Rudzynski <mr@impaled.org>
Date: Thu, 26 May 2011 11:00:27 +0200
Subject: use association_primary_key in AssociationScope#add_constraints

---
 activerecord/lib/active_record/associations/association_scope.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'activerecord/lib')

diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb
index 94847bc2ae..9e6d9e73c5 100644
--- a/activerecord/lib/active_record/associations/association_scope.rb
+++ b/activerecord/lib/active_record/associations/association_scope.rb
@@ -60,7 +60,7 @@ module ActiveRecord
 
             scope = scope.joins(join(
               join_table,
-              table[reflection.active_record_primary_key].
+              table[reflection.association_primary_key].
                 eq(join_table[reflection.association_foreign_key])
             ))
 
-- 
cgit v1.2.3