From 52ff5a7d5a3eb414c4884ede106de35edcb7d504 Mon Sep 17 00:00:00 2001 From: Jason Butz Date: Fri, 18 Apr 2014 12:33:45 -0400 Subject: [PATCH] feat(archive_todo): update to archive todos I thought this bit of code was in the other repo. So long as part 3 follows close behind this, there shouldn't be an issue --- script/index.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/index.coffee b/script/index.coffee index 7a6d66b5da..f410d4d51c 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -485,7 +485,9 @@ api.wrap = (user, main=true) -> # ------ clearCompleted: (req, cb) -> - _.remove user.todos, (t)-> t.completed and !t.challenge?.id + user.todos = _.map user.todos, (t)-> + t.archived = true if t.completed and !t.challenge?.id + t user.markModified? 'todos' cb? null, user.todos