sedge / opendojo

An open-source student and class management system for traditional karate clubs
Mozilla Public License 2.0
2 stars 0 forks source link

implemented rank unit tests and routes #45

Closed AlinaShtramwasser closed 9 years ago

AlinaShtramwasser commented 9 years ago

Kieran this has the fixes to your comments and the rank addition + subtraction logic moved to the hooks. Please peer review.

AlinaShtramwasser commented 9 years ago

This has the ranks and the students routes + unit tests implemented and validation being used for the POST method -- the update remains unchanged -- here's a quote from a stackoverflow discussion I found "validation is implemented as internal middleware within Mongoose and middleware doesn't get executed during an update as that's basically a pass-through to the native driver. If you want your client update validated you'll need to find the object to update, apply the new property values to it (see underscore's extend method), and then call save on it." http://stackoverflow.com/questions/15627967/why-mongoose-doesnt-validate-on-update It sounds a little convoluted to me -- I'm debating leaving the logic for the checks in the routes for the update method. What do u think?

sedge commented 9 years ago

@AlinaShtramwasser You're getting close! Ping me when you've addressed my comments.