Class: PasswordResetToken

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/password_reset_token.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_expirationObject



12
13
14
# File 'app/models/password_reset_token.rb', line 12

def default_expiration
  24.hours
end

.expire!Object



16
17
18
# File 'app/models/password_reset_token.rb', line 16

def expire!
  expired.delete_all
end

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/models/password_reset_token.rb', line 21

def expired?
  expires_at < Time.now.utc
end