When the hash argument for set() contains embedded fields like fields declared by embeds_one, the field does not get persisted to db. (In fact, it is persisted to db and then rewrite as nil)
This is what happens underneath:
After each field is processed, only the relationship fields are persisted, and normal fields are only set on the object.
At this line, field assignment are inserted in a hash named ops, which will be eventually used to persist all fields involved.
This is where the relationship fields get missed, since the value of relationship fields are not inside attributes, therefore it gets a nil value instead, which caused the final data persisted on db to be nil.
a PR is proposed:
Please take a look, thanks!