Permalink
Browse files

Fix test_has_many_association_through_a_has_many_association_with_non…

…standard_primary_keys
  • Loading branch information...
1 parent cee3f9b commit bb063b2f1b3e5b6fb2a4732cb696929f1652c555 @jonleighton jonleighton committed Mar 7, 2011
@@ -82,7 +82,7 @@ def join_to(scope)
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
@@ -372,7 +372,7 @@ def derive_foreign_key
# 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>.

0 comments on commit bb063b2

Please sign in to comment.