[#1729] move most chal-user syncing logic to their models rather than

controllers. don't sync task.value or task.history over to user on
challenge.join()! some work-arounds for the task._id/id mismatch (still
not perfect, need to work on some more)
This commit is contained in:
Tyler Renelle
2013-11-03 22:33:53 -08:00
parent 7060f75c83
commit 452c4e1ece
5 changed files with 136 additions and 110 deletions
+7
View File
@@ -38,4 +38,11 @@ var TaskSchema = new Schema({
_id: false
});
/**
* Workaround for bug when _id & id were out of sync, we can remove this after challenges has been running for a while
*/
TaskSchema.post('init', function(doc){
if (!doc.id && doc._id) doc.id = doc._id;
})
module.exports.schema = TaskSchema;