composite-primary-keys/composite_primary_keys — pull request #259 by zaldabus (2014-11-17 13:36:33+00:00)
Title: Adds testing coverage for nested_attributes which use a string as part of their composite primary key.

So after having taken a closer look at the tariff and product_tariff models (and the product model which completes the many-to-many association) I realized that these models would not be a viable base for using as test coverage for nested_attributes with a string. The only part of the association that has a string is the product_tariff model which is being used as a join table, and any change to the tariff or product models would result in a completely new database entry. The nested attributes issue concerned updates to nested_attributes, so the combination of these two concerns means these models wouldn't be appropriate for the necessary coverage.

A further look at all of the models currently available in fixtures shows no models that would be appropriate for the necessary coverage. This is probably a good basis for why this bug was never caught before.

In conclusion, even though there are quite a few fixtures already for testing, it is necessary to add some more to properly cover this test case. I've gone ahead and readded the tests I initially put in for nested_attributes as well as the fixtures and db queries to properly set everything up.