If conditions is an embeds_many association on a contract, and I do:
... the contract does not have a conditions field written to the database.
If I write a non-empty array to conditions, and then set conditions to an empty array, it is persisted as expected:
However, if the base model is unsaved, even setting conditions to a non-empty array prior to persistence is insufficient to force an empty array to be written out. The following does not write anything into conditions:
Note that Mongoid converts the missing attribute to an empty array, so as far as Mongoid application is concerned the conditions are still usable and have the right content. But the persisted data does not match what it should be (actual: missing value, expected: an empty array).