-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
As discussed in the slack, embedded noSQL relationships are not easily integratable in JsonapiCompliable module.
The current logic assumes a foreign_key is required to save associations, however Mongoid's embeds_one and embeds_many do not require the foreign key but the parent object itself. The nested objects are directly added as an attribute hash to the parent_object. It is almost as if it behaved as an attribute (with the big difference that embedded records are identified by an ID, indexable, and a special Mongoid proxy allows to use Active Model scopes on embedded relations)
In a nutshell, the resource #create, #update, and maybe even #destroy methods need a way to access the parent_object of the relation.
Metadata
Metadata
Assignees
Labels
No labels