Closed nelsonwittwer closed 1 year ago
@mvanholstyn - I'm going to do more testing to verify this fix, but you would mind testing this solution with your workflow as well?
Looking at the reported issue, it looks like we need to also make sure we are sending the required IDs. I'll add that fix as well here before getting review.
Edit - this is going to be trickier than I had hoped and will need a change to our REST resources. Moving ahead with this change for now to fix the new attributes
Description
As mentioned in #1164, change tracking for associated records is prone to errors. Especially when modifying a
has_many
association.The root cause was an erroneous implementation of
HashDiff#left_diff
when removing or adding associated objects. When the key wasn't present in the original, whichHashDiff#left_diff
would return a{0=> HashDiff::NO_VALUE}
as the value, we will now return whatever the current state of the object is since the original state didn't have that key.How has this been tested?
Unit test + recreating reports in console.
Checklist: