Sha256: fe05a2147f7b695981acfb47fc6a96b9b0f2e5c6809a1a83e75c4fffa0960712

Contents?: true

Size: 563 Bytes

Versions: 4

Compression:

Stored size: 563 Bytes

Contents

# because user passwords are hashed both on a production server, and locally, a
# random salt can't be added to the password. clients will send the hashed
# version of the password, so a simple comparison to the stored password is ok.
class ProductionUser < User
  def create_salt_and_hash_password
    self.password_salt = nil
  end

  def hash_password
    return unless password_changed? && password?
    self.password = Password.hashed_password(nil, password)
  end
  
  def passwords_match?(password)
    self.password_was == password ? self : nil
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yodel_production_environment-0.0.7 lib/models/production_user.rb
yodel_production_environment-0.0.4 lib/models/production_user.rb
yodel_production_environment-0.0.2 lib/models/production_user.rb
yodel_production_environment-0.0.1 lib/models/production_user.rb