Class: Devise::Models::PreviousPassword

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/devise/secure_password/models/previous_password.rb

Instance Method Summary collapse

Instance Method Details

#fresh?(minimum_age_duration, now = ::Time.zone.now) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/devise/secure_password/models/previous_password.rb', line 11

def fresh?(minimum_age_duration, now = ::Time.zone.now)
  now <= (created_at + minimum_age_duration)
end

#stale?(maximum_age_duration, now = ::Time.zone.now) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/devise/secure_password/models/previous_password.rb', line 15

def stale?(maximum_age_duration, now = ::Time.zone.now)
  now > (created_at + maximum_age_duration)
end