another fix on duplicates

This commit is contained in:
Tyler Renelle 2013-01-31 21:50:36 -05:00
parent 995e699130
commit 0a59d6e43d

View file

@ -52,4 +52,5 @@ module.exports.updateUser = (user, userObj) ->
preened = _.filter(union, (val) -> _.contains(taskIds, val))
# There were indeed issues found, set the new list
user.set(path, preened) if _.size(preened) != _.size(userObj[path])
# TODO _.difference might still be empty for duplicates in one list?
user.set(path, preened) if _.difference(preened, userObj[path]).length != 0