Module: Devise::Models::Expirable

Extended by:
ActiveSupport::Concern
Defined in:
lib/devise/expirable/model.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#active_for_authentication?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/devise/expirable/model.rb', line 16

def active_for_authentication?
  password_still_valid? && super
end

#inactive_messageObject



30
31
32
# File 'lib/devise/expirable/model.rb', line 30

def inactive_message
  password_expired? ? :password_expired : super
end

#password_expirate_inObject



12
13
14
# File 'lib/devise/expirable/model.rb', line 12

def password_expirate_in
  self.class.password_expirate_in
end

#password_expired?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/devise/expirable/model.rb', line 26

def password_expired?
  !password_still_valid?
end

#password_still_valid?Boolean

Returns:

  • (Boolean)


20
21
22
23
24
# File 'lib/devise/expirable/model.rb', line 20

def password_still_valid?
  return false unless expiration_password_at

  expiration_password_at >= Time.current
end