You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var queue=this.store.createRecord("queue",{time_added:"2014-04-26",description:"Good to have at this time"});
this.store.find('video',44).then(function(data){
queue.set('video',data);
queue.save();
});
response after save will be
{queue:{id:1,time_added:"2014-04-26",description:"Good to have at this time",video:44},
video:[{
id:44,
video_url:"beauty.png",
title:"Cool dance",
duration:"30",
queue:1
}]
}
Now it will create new record in the store . But the problem is after save when i check the queue computed property it shows "App.Queue:ember1724:null" [in belongsTo relationship] and when i click on this property it will fetch new record from the server with the same id and remaining values are undefined . I am having doubt that why it should fetch new queue record with same id if it is already there ?
I think you understand my problem . Thanks in advance .
The text was updated successfully, but these errors were encountered:
maheshiv
changed the title
Ember Data BelongTo Relationship : Error in fetching record after save
Ember Data BelongTo Relationship :Duplicate record after save
Apr 29, 2014
@igorT@stefanpenner Any new information on this issue? I met the same problem on saving a new embedded "belongsTo" record.
I understand that when sending a non-id embedded record to server and server returns the same record with id, Ember Data will think that server's response is a new record, but not updating the old non-id record. But I'm curious same situation happens when creating a new record (non-embedded) using a POST request, and Ember Data knows that the server response is for that new record. I'm looking at the source to see how Ember Data do it. Maybe it helps.
I am using ember data for my application . I defined two models with belongsTo relationship
For adding a video to queue , I do
response after save will be
Now it will create new record in the store . But the problem is after save when i check the queue computed property it shows "App.Queue:ember1724:null" [in belongsTo relationship] and when i click on this property it will fetch new record from the server with the same id and remaining values are undefined . I am having doubt that why it should fetch new queue record with same id if it is already there ?
I think you understand my problem . Thanks in advance .
The text was updated successfully, but these errors were encountered: