fixed undo on checkboxed items

This commit is contained in:
Tyler Renelle 2013-03-17 21:43:03 -04:00
parent 2f3d0fa86a
commit 10e9d3eb40

View file

@ -207,7 +207,11 @@ module.exports.app = (appExports, model) ->
batch.startTransaction()
_.each undo.stats, (val, key) -> batch.set "stats.#{key}", val
taskPath = "tasks.#{undo.task.id}"
_.each undo.task, (val, key) -> batch.set "#{taskPath}.#{key}", val
_.each undo.task, (val, key) ->
if key is 'completed'
user.pass({cron:true}).set("#{taskPath}.completed",val)
else
batch.set "#{taskPath}.#{key}", val
batch.commit()
model.del '_undo'