I use the mongoid_denormalize plugin, and I noticed that my associations were getting corrupted. I did a bunch of work to pull out the issue out of the plugin, and came up with the repro below using just mongoid (latest gem). Basically, I have two one-to-many relationships to the same class, and in the child class I load the parent relationships in a before_save callback. Then mongoid mixes up the relationships.
I know it's a bit of a weird scenario, but it's been running amok in my code for a few days, and resulted in a bunch of hair loss. I don't know if it's a bug, some issue in how I've defined the classes, or simply not supported. If it's the last, I need to patch that plugin, which loads the relationship in the callback in order to denormalize fields from the parent side of the relationship into the child side. So any guidance there would helpful.