Class: User

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/user.rb

Constant Summary collapse

VALID_EMAIL_REGEX =
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i

Class Method Summary collapse

Class Method Details

.encrypt(token) ⇒ Object



24
25
26
# File 'app/models/user.rb', line 24

def User.encrypt(token)
  Digest::SHA1.hexdigest(token.to_s)
end

.secure_random_tokenObject



20
21
22
# File 'app/models/user.rb', line 20

def User.secure_random_token
  SecureRandom.urlsafe_base64
end