The reference documentation does not currently explicitly document the #attributes method. There are however several instances of it being used to demonstrate the results of other operations.
In https://jira.mongodb.org/browse/MONGOID-4397 a special case was added for embedded associations: they are not returned from #attributes when they are an empty array. This could be important and should be part of the documentation in scope of this ticket.
Documentation should state:
Whether the return value is a Hash or BSON::Document (indifferently accessible)
Whether values are stored after mongoization
Whether embedded associations are included
- related to
-
MONGOID-4397 update_attributes does not reflect changes to embedded documents in the attributes hash
- Closed
-
MONGOID-5346 #attributes is sometimes Hash and sometimes BSON::Document
- Closed