unloadRecord() not unloading properly in forEach loop


#1

Here is my code below. I have 60 question records that belong to an exam object. I use the forEach loop and unload eachrecord when updating the data from the server. It’s strange but only 30 out of the 60 questions get unloaded (I see 30 in the ember inspector but in the site the questions array in the exam object displays no record!)

Is it a issue with the inspector or are all those records cached in somewhere?

Thanks for your help!

exam.get('questions').get('content').forEach(function (outdatedquestion){
    outdatedquestion.unloadRecord();
});
data.Exam_Questions__r.records.forEach(function (question){
 	store.createRecord('exam-question', {
	    question : question.Question__r.Question__c,
	    questionID : question.Name,
	    answer1 : question.Question__r.Answer_1__c,
	    answer2 : question.Question__r.Answer_2__c,
	    answer3 : question.Question__r.Answer_3__c,
	    answer4 : question.Question__r.Answer_4__c,
	    answer5 : question.Question__r.Answer_5__c,
	    answer6 : question.Question__r.Answer_6__c,
	    answer7 : question.Question__r.Answer_7__c,
	    numberOfAnswers : question.Question__r.Number_of_Answers__c,
	    solutions : question.Question__r.Solutions__c,
	    examID : question.Exam_Name__c,
	    chosenAnswers : question.Answer_Chosen__c,
	    result : question.Result__c,
	    userexam: exam,
	    lastUpdated: moment(question.LastModifiedDate)
    });
});