expired password last

This commit is contained in:
Marcia
2016-10-06 14:19:48 +02:00
parent 1f72c5cc74
commit 680c0636ed
4 changed files with 9 additions and 19 deletions

View File

@@ -41,16 +41,8 @@ module Devise
module Models
module PasswordExpirable
def need_change_password?
if password_change?
password_expired?
else
false
end
end
def password_change?
self.administrator? && password_expired?
end
end
def password_expired?
self.password_changed_at < self.expire_password_after.ago