The pull request with all the code.

can any of the above be null? if not, you should add protection. It's not enough to just have rails validations. see here: http://robots.thoughtbot.com/avoid-the-threestate-boolean-problem