The pull request with all the code.

actually this is the old way of doing it, the way you have it is much more extensible if you need to add an additional validation on a specific attribute.