Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import DS from 'ember-data';
import MF from 'ember-data-model-fragments';
export default DS.Model.extend({
title: DS.attr('string'),
nickName: DS.attr('string'),
name: MF.fragment('name'),
names: MF.fragmentArray('name'),
addresses: MF.fragmentArray('address'),
titles: MF.array(),
hobbies: MF.fragmentArray('hobby', { defaultValue: null }),
houses: MF.fragmentArray('house'),
children: MF.array(),
strings: MF.array('string'),
numbers: MF.array('number'),
booleans: MF.array('boolean')
});
import DS from 'ember-data';
import MF from 'ember-data-model-fragments';
export default DS.Model.extend({
name: DS.attr('string'),
city: DS.attr('string'),
star: MF.fragment('animal', { polymorphic: true, typeKey: '$type' }),
animals: MF.fragmentArray('animal', { polymorphic: true, typeKey: '$type' }),
manager: DS.belongsTo('person')
});
import MF from 'ember-data-model-fragments';
import DS from 'ember-data';
export default MF.Fragment.extend({
amount: DS.attr('string'),
recurring: DS.attr('boolean'),
products: MF.fragmentArray('product'),
product: MF.fragment('product')
});