Here is the technology stack I'm currently using:
Ember 1.10.0 Ember Data 1.0.0-beta.15
Within my application, I have defined a model as shown below:
//models//acceptedtask.js
import DS from "ember-data";
export default DS.Model.extend({
userAggregateId: DS.attr('number'),
taskAggregateId: DS.attr('number'),
name: DS.attr('string')
});
The server response for this model data looks like this:
{"acceptedTask":{"id":5,"userAggregateId":1,"taskAggregateId":3,"name":"Clean table"}}
Upon receiving this JSON data, Ember throws an error message similar to the following:
Error: Assertion Failed: You must include an `id` for task-management@model:acceptedtask: in an object passed to `push`
at new Error (native)
at Error.EmberError (http://localhost:4200/assets/vendor.js:22992:23)
at Object.Ember.assert (http://localhost:4200/assets/vendor.js:14489:15)
at Ember.Object.extend.push (http://localhost:4200/assets/vendor.js:74317:15)
at http://localhost:4200/assets/vendor.js:74783:24
at Object.Backburner.run (http://localhost:4200/assets/vendor.js:10749:27)
at ember$data$lib$system$store$$_adapterRun (http://localhost:4200/assets/vendor.js:74759:32)
at http://localhost:4200/assets/vendor.js:74780:16
at tryCatch (http://localhost:4200/assets/vendor.js:60990:16)
at invokeCallback (http://localhost:4200/assets/vendor.js:61002:17)
If anyone has encountered a similar issue or can provide assistance with resolving it, please let me know. I've searched extensively online but haven't been able to find a solution.
Thank you,
-Tom