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