From ec44763f03b49e8c6e3bff71772ba32863a01306 Mon Sep 17 00:00:00 2001 From: Mohammad El-Abid Date: Thu, 26 May 2011 00:54:51 -0400 Subject: Removes the restriction on primary key when joining in a habtm && test that it was properly removed --- .../lib/active_record/associations/builder/has_and_belongs_to_many.rb | 4 ---- 1 file changed, 4 deletions(-) (limited to 'activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb') diff --git a/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb b/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb index 4b48757da7..d7632b2ea9 100644 --- a/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb +++ b/activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb @@ -39,10 +39,6 @@ module ActiveRecord::Associations::Builder model.send(:undecorated_table_name, model.to_s), model.send(:undecorated_table_name, reflection.class_name) ) - - if model.connection.supports_primary_key? && (model.connection.primary_key(reflection.options[:join_table]) rescue false) - raise ActiveRecord::HasAndBelongsToManyAssociationWithPrimaryKeyError.new(reflection) - end end # Generates a join table name from two provided table names. -- cgit v1.2.3