     User.validateUsername @username
 
   validatePasswordHash: () ->
-    User.validatePasswordHash @password_hash
+    User.validatePasswordHash @passwordHash
 
   validateEmail: () ->
     User.validateEmail @email


    return true

  @validatePasswordHash: (password_hash) ->
    unless password_hash?
      throw new @ValidationError "Password hash must exist"

    unless /\S+/.test password_hash
      throw new @ValidationError "Password hash must not be blank"

    return true

  #     user = new User
  #       username:      'demosthenes'
  #       email:         'demos@athens.net'
  #       passwordHash:  '$2a$12$6nZyzVgeCmBK9JkZb9rNG.9s/d/i/g2Tbyf4vk318XQLQKi4GXXZ2'
  #
  # @api public
  # @see Users#create()
  # @param [Object] params A hash of user params.
  # @param [String] params.username The user's login name.
  # @param [String] params.email    The user's email adress.
  # @param [String] params.passwordHash The user's password hash.
  constructor: (@username, @email, @passwordHash) ->
    if arguments.length == 1 and arguments[0].username
      params = arguments[0]
      @username      = params.username
      @email         = params.email
      @passwordHash  = params.passwordHash or params.password_hash

  ### Instance Methods ###

