From b1ea27630df0f0639900b321d756091b42ed29f7 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 2 Feb 2008 03:27:31 +0000 Subject: Fix has_many :through a polymorphic has_many. Closes #10529 [Aleksey Kondratenko] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8776 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/associations/has_many_through_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index 96d0b73da2..06ea5d1d1c 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -212,7 +212,7 @@ module ActiveRecord def construct_joins(custom_joins = nil) polymorphic_join = nil - if @reflection.through_reflection.options[:as] || @reflection.source_reflection.macro == :belongs_to + if @reflection.source_reflection.macro == :belongs_to reflection_primary_key = @reflection.klass.primary_key source_primary_key = @reflection.source_reflection.primary_key_name if @reflection.options[:source_type] -- cgit v1.2.3