[#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:
@@ -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;
|
||||
Reference in New Issue
Block a user