aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-03-07 20:58:32 +0000
committerJon Leighton <j@jonathanleighton.com>2011-03-07 20:58:32 +0000
commitbb063b2f1b3e5b6fb2a4732cb696929f1652c555 (patch)
tree9cb4de7d9284d59d9a555154bdc73b8c78f2c1c0 /activerecord/lib
parentcee3f9b36d01e6d54e0bd4c2fd06bee369bfff12 (diff)
downloadrails-bb063b2f1b3e5b6fb2a4732cb696929f1652c555.tar.gz
rails-bb063b2f1b3e5b6fb2a4732cb696929f1652c555.tar.bz2
rails-bb063b2f1b3e5b6fb2a4732cb696929f1652c555.zip
Fix test_has_many_association_through_a_has_many_association_with_nonstandard_primary_keys
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/associations/through_association.rb2
-rw-r--r--activerecord/lib/active_record/reflection.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/through_association.rb b/activerecord/lib/active_record/associations/through_association.rb
index 5768915eaf..ae2c8b65ed 100644
--- a/activerecord/lib/active_record/associations/through_association.rb
+++ b/activerecord/lib/active_record/associations/through_association.rb
@@ -82,7 +82,7 @@ module ActiveRecord
foreign_key = reflection.foreign_key
else
key = reflection.foreign_key
- foreign_key = reflection.association_primary_key
+ foreign_key = reflection.active_record_primary_key
end
if reflection == through_reflection_chain.last
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 5199886f79..0a9855ec25 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -372,7 +372,7 @@ module ActiveRecord
# Holds all the meta-data about a :through association as it was specified
# in the Active Record class.
class ThroughReflection < AssociationReflection #:nodoc:
- delegate :foreign_key, :foreign_type, :association_foreign_key, :to => :source_reflection
+ delegate :foreign_key, :foreign_type, :association_foreign_key, :active_record_primary_key, :to => :source_reflection
# Gets the source of the through reflection. It checks both a singularized
# and pluralized form for <tt>:belongs_to</tt> or <tt>:has_many</tt>.