drnic/composite_primary_keys — pull request #112 by codeodor (2012-06-08 12:41:16+00:00)
Title: Fixes problem with deleting non-CPK in Rails 3.2.5 (perhaps prior versions too)

Somewhere along the line, the symbol `:all` started being passed as the records parameter, to the delete_records method in ActiveRecord::Associations::HasAndBelongsToManyAssociation.

This was breaking since it calls #map on that parameter.

I added a new table to the fixtures for four DBs, and a new relationship not involving CPKs between employees and groups, added a test to show the failure, and finally fixed it in the last commit.

(I also added a commit -- the first one -- to run mysql DB create one statement at a time, because it doesn't seem to like multiple statements in one run since I upgraded to Mac OSX Lion. Also, I thought ActiveRecord started disallowing this, but it seemed to work OK for postgresql).

Anyway, the tests run fine on mysql and postgresql. I did not have the other DBs handy.