Sha256: 27e58562833fee5baeb192e774e8fe2e226f19f52fe6fb8d6bd073ad3350c3f1

Contents?: true

Size: 453 Bytes

Versions: 7

Compression:

Stored size: 453 Bytes

Contents

require 'eucalypt/eucalypt-security/namespaces/security-warden/user_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

7 entries across 7 versions & 1 rubygems

Version Path
eucalypt-0.2.2 lib/eucalypt/eucalypt-security/namespaces/security-warden/templates/user.tt
eucalypt-0.2.1 lib/eucalypt/eucalypt-security/namespaces/security-warden/templates/user.tt
eucalypt-0.2.0 lib/eucalypt/eucalypt-security/namespaces/security-warden/templates/user.tt
eucalypt-0.1.3 lib/eucalypt/eucalypt-security/namespaces/security-warden/templates/user.tt
eucalypt-0.1.2 lib/eucalypt/eucalypt-security/namespaces/security-warden/templates/user.tt
eucalypt-0.1.1 lib/eucalypt/eucalypt-security/namespaces/security-warden/templates/user.tt
eucalypt-0.1.0 lib/eucalypt/eucalypt-security/namespaces/security-warden/templates/user.tt