Created
May 10, 2011 15:47
-
-
Save topherfangio/964723 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var requests = nestedStore.find(requestsQuery); | |
console.log("\n"); | |
console.log('BEGIN'); | |
var responseSets = nestedEvaluation.get('response_sets'); | |
console.log(' responseSets BEFORE forEach:', responseSets.toArray()); | |
requests.forEach(function(request) { | |
var student = nestedStore.find(Core360.Student, request.get('student_id')); | |
var course = nestedStore.find(Core360.Course, request.get('course_id')); | |
var set = nestedStore.createRecord(Core360.EvaluationResponseSet, { | |
evaluation: nestedEvaluation.get('id'), | |
student: request.get('student_id'), | |
course: request.get('course_id'), | |
responses: [] | |
}); | |
console.log(' set DURING forEach:', set); | |
responseSets.pushObject(set); | |
}); | |
console.log(' responseSets.length AFTER forEach:', responseSets.get('length')); | |
console.log(' responseSets AFTER forEach:', responseSets.toArray()); | |
console.log('END'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Core360.Evaluation = SC.Record.extend( | |
/** @scope Core360.Evaluation.prototype */ { | |
response_sets: SC.Record.toMany('Core360.EvaluationResponseSet', { isMaster: NO }) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN | |
responseSets BEFORE forEach: [] | |
set DURING forEach: Core360.EvaluationResponseSet({evaluation: 78 , student: Q1004 , course: null , responses: }) READY_NEW { __sc_super__=[unsupported: no toString() function in type object], storeKey=534, more...} | |
responseSets.length AFTER forEach: 1 | |
responseSets AFTER forEach: [undefined] | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment