-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
Description
I can't seem to get this example
const postProps = {
title: 'Relations',
comments: [
{
content: 'Awesome!'
},
{
content: 'So cool!'
}
]
};
store.create('post', postProps, { pass: ['comments'] })
.then((post) => {
// done
post.id === post.comments[0].post_id; // true!
});at https://www.js-data.io/docs/relations#section-deep-creating-relations to work.
Although the objects serialize properly, the base adapter's withoutSerialization call on create, createMany, update, etc... filters out the relations because it expects the whitelisted relations to be specified in opts.with instead of opts.pass.
Septaris and XT-Martinez