This control added because when I try to add an additional model serializer with embed options, it assumes there is a hasMany relation but function (snapshot.hasMany) returns undefined.
Example:
X Model:
name: DS.attr(),
attr: DS.hasMany('attr'),
Y Model:
code: DS.attr(),
xs: DS.belongsTo('X')
Y Serializer:
import ApplicationSerializer from './application';
import DS from 'ember-data';
export default ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
attrs: {
xs: { embedded: 'always' },
},
});
In example, I want to use embedded "xs" when I save model but it gets error due to X.attr.
This control added because when I try to add an additional model serializer with embed options, it assumes there is a hasMany relation but function (snapshot.hasMany) returns undefined. Example:
In example, I want to use embedded "xs" when I save model but it gets error due to X.attr.