Module: Devise::Models::PasswordExpirable

Extended by:
ActiveSupport::Concern
Defined in:
lib/devise/models/password_expirable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#expire_password_afterObject



17
18
19
# File 'lib/devise/models/password_expirable.rb', line 17

def expire_password_after
  self.class.expire_password_after
end

#need_change_password?Boolean

is an password change required?

Returns:

  • (Boolean)


9
10
11
12
13
14
15
# File 'lib/devise/models/password_expirable.rb', line 9

def need_change_password?
  if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float
    self.password_changed_at.nil? or self.password_changed_at < self.expire_password_after.ago
  else
    false
  end
end