fix(challenges): since we're setting {minimize:false} on tasks, don't

overwrite user tasks.*.challenges in the _.merge()
This commit is contained in:
Tyler Renelle
2014-10-03 14:33:57 -06:00
parent 704a8658f3
commit 0bb1de680c
2 changed files with 2 additions and 17 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ ChallengeSchema.methods.toJSON = function(){
function syncableAttrs(task) {
var t = (task.toObject) ? task.toObject() : task; // lodash doesn't seem to like _.omit on EmbeddedDocument
// only sync/compare important attrs
var omitAttrs = 'history tags completed streak notes'.split(' ');
var omitAttrs = 'challenge history tags completed streak notes'.split(' ');
if (t.type != 'reward') omitAttrs.push('value');
return _.omit(t, omitAttrs);
}