Summary
Mongoid::Association::Nested::Many#update_nested_relation raises Mongoid::Errors::UnknownAttribute when nested attributes include _destroy: true for a child whose _id is not already in the parent's relation (e.g. a new parent receiving an existing child's _id).
The if branch strips _destroy via destroyable? before calling update_document. The else branch calls update_document first, so _destroy is still in the attrs hash when assign_attributes is invoked — and any model without a _destroy field (and without Mongoid::Attributes::Dynamic) blows up.
Expected
The _destroy directive is honored or silently no-ops. No exception for a documented nested-attributes key.
Actual
Mongoid::Errors::UnknownAttribute: Attempted to set a value for '_destroy' which is not allowed on the model Child.