diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 1b1546fe65..40a5e5f2d1 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -174,7 +174,7 @@ module ActiveRecord end if source_reflection.options[:polymorphic] - raise HasManyThroughAssociationPolymorphicError.new(class_name, @reflection, source_reflection) + raise HasManyThroughAssociationPolymorphicError.new(class_name, self, source_reflection) end end end