Update user.rb

The before_save callback should be placed after the validate statments, otherwise the DB will attempt to save before validation, causing errors.