Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
A fix for issue #1360 #1389
I took a look at issue #1360 and found out what the problem was. It seems that the latest refactoring of collection_association.rb used both create and save! to perform a create!. This caused the double-callbacks to be triggered.
The patch is essentially an unrefactoring of create! to mimic what create currently does. I had to add in an extra parameter to insert_record to use either save or save!.
I wrote a simple test to check if the callbacks were getting called more than once. It should capture the problem that was found in issue #1360.
As it stands, there are 7 other tests that are failing, but they seem to be existing problems, as ever time I've cloned I get the same 7 failures. And my modifications don't seem to change the results of those failures, so I'm fairly certain they are unrelated.
Thanks for taking a look,