-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Associations, Callbacks
Possible duplicate of https://jira.mongodb.org/browse/MONGOID-3795.
When an embedded doc is set via the parents setter (#doc=), it is not available for the parent, when the embedded after_save callback is fired.
To clarify the problem, i wrote a small test:
https://gist.github.com/romanlehnert/e0a4b614fabdc89c4fbb2efd5b3181a0
In the test, i expect the Syncer to receive .perform with the customers address. But actually, it is given nil instead of the address.
Is this the desired behavior? It seems unexpected for me.
Env:
- ruby 2.3.0
- mongoid 5.0.1
- related to
-
MONGOID-3795 Clarify/improve order of callback invocation on embedded associations vs host documents
- Closed