Sha256: be8b4f39552979913a827f27745e927cf5e377d28aadb40665aa449faa8ebf6c

Contents?: true

Size: 412 Bytes

Versions: 21

Compression:

Stored size: 412 Bytes

Contents

require 'eucalypt/security/confirm'
class User < ActiveRecord::Base
  validates :username, presence: true, uniqueness: true
  validates :encrypted_password, presence: true

  include BCrypt

  def authenticate(attempt)
    Password.new(self.encrypted_password) == attempt
  end

  def password=(entered_password)
    @password = Password.create(entered_password)
    self.encrypted_password = @password
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
eucalypt-0.8.0 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.7.2 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.7.1 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.7.0 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.6.2 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.6.1 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.6.0 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.5.4 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.5.3 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.5.2 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.5.1 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.5.0 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.4.2 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.4.1 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.4.0 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.3.5 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.3.4 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.3.3 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.3.2 lib/eucalypt/security/namespaces/security-warden/templates/user.tt
eucalypt-0.3.1 lib/eucalypt/security/namespaces/security-warden/templates/user.tt