challenges: better unlinkig of tasks on unsubscribe

This commit is contained in:
Tyler Renelle
2013-10-27 10:38:28 -07:00
parent fa25f3d300
commit d60a56432f
9 changed files with 112 additions and 266 deletions

View File

@@ -25,7 +25,12 @@ var TaskSchema = new Schema({
completed: {type: Boolean, 'default': false},
priority: {type: String, 'default': '!'}, //'!!' // FIXME this should be a number or something
repeat: {type: Schema.Types.Mixed, 'default': {m:1, t:1, w:1, th:1, f:1, s:1, su:1} },
streak: {type: Number, 'default': 0}
streak: {type: Number, 'default': 0},
challenge: {
id: {type: 'String', ref:'Challenge'},
broken: {type: Boolean, 'default': false}
// group: {type: 'Strign', redf: 'Group'} // if we restore this, rename `id` above to `challenge`
}
});
TaskSchema.methods.toJSON = function() {