Closed erickipnis closed 8 years ago
One complication I just thought of is that when an Idea is removed it also needs to be removed from all the IdeaCollections as well.
This is kind of tricky and makes me think we should just let this one fall out of the release. At least until Monday.
There is apparently no way to define a cascade delete or dependent destroy in Mongo/Mongoose and best practice is to use the remove
middleware (like we do with duplicate checks on save). Basically we're going to have to grab all the IdeaCollection's idea collections (lol) and pull out the ones whose idea id match what we just deleted.
That sound's god awful, but yeah that's a good point. Let's proceed with a solution for that on Monday.
Implemented cascading removal of removed idea from idea collections that contained the idea.
Fixed the anonymous function to use .spread instead.