codecombat/codecombat — pull request #1239 by rubenvereecken (2014-06-28 12:05:55+00:00)
Title: Added pendingPatches to patchables to keep track

This isn't finished yet.. But I'm stuck with a problem so far and I figured this would be the best place to ask, it might even be related with the currently existing Patch problems.

I added some middleware that keeps track of the amount of pending patches. I tried lots of different approaches, this one seemed best. The current problem is that pendingPatches is set on the wrong document (the one the patch was for) instead of on the last level. I don't know what the best approach would be to have this value on the latest, always. I'm not very good with the versioned system either.

The reason I added this field was I felt the badge (notification-like) should only show the amount of patches that need a developer's attention, not the ones already dealt with. Hence _pendingPatches_.