I have a model named 'someModel' is as follows
import DS from 'ember-data';
export default DS.Model.extend({
type: DS.attr('string'),
email: DS.attr('string'),
days: DS.attr('number'),
isInstant: DS.attr('boolean'),
cutHours: DS.attr('number')
});
and by default I need an array of 4 records of this model with default values as follows
"someModel": [{
"type": "Booking",
"email": "sunny.wayne@some.com,mahela.jayawardane@some.com",
"isInstant": true,
"cutHours": 72,
"days": -1
},
{
"type": "Booking",
"email": "",
"isInstant": false,
"cutHours": 72,
"days": -1
},
{
"type": "Arrival",
"email": "mahela.jayawardane@some.com",
"isInstant": false,
"cutHours": 72,
"days": 1
},
{
"type": "Cancellation",
"email": "sunny.wayne@some.com",
"isInstant": false,
"cutHours": 72,
"days": -1
}
]
Whats the ideal way to do this? I looked at the createRecord, but only one record can be created at a time. My backend logic expecting the data to be in the above format and I will also have to update the 4 records that are created depending on the user action.