   /^(?=[^\d_].*?\d)\w(\w|[!@#$%]){5,20}/.test value
 , 'Your password must be between 6–20 characters, start with a letter, and include a number.'
 
+userSchema.post 'validate', ->
+  @password = bcrypt.hashSync @password, bcrypt.genSaltSync()
+
 userSchema.plugin uniqueValidator, message: '“{VALUE}” is already a user.'
 
 userSchema.set 'toJSON', virtuals: true
 
-module.exports = db.model 'User', userSchema+module.exports = db.model 'User', userSchema

Schema = mongoose.Schema

userSchema = new Schema
  name: 
    type: String
    required: true
  email: 
    type: String
    required: true
    lowercase: true

  password:
    type: String
    required: true
  activated:
    type: Boolean
    default: false
  last_active:
