-
Type: Improvement
-
Resolution: Fixed
-
Priority: Trivial - P5
-
Affects Version/s: None
-
Component/s: Associations, Docs
-
None
-
Fully Compatible
Mongoid permits hash to be assigned to an association like so:
band.manager = {name: 'boss'}
This behavior does not exist in Rails and appears to be undocumented in Mongoid. It should be documented in the reference somewhere.
Additionally, the substitute method as per the comment in https://github.com/mongodb/mongoid/pull/5232 has incorrect docstring: it claims that replacement is a Document but it can be a Hash as per this ticket. Correcting that docstring is also in scope of this ticket.
Test and update all of the substitute methods to see if they can take hashes
Test and update all of the batchable methods to see if they can take hashes as well.