Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
replace Fixnum references
Browse files Browse the repository at this point in the history
  • Loading branch information
3zcurdia committed Dec 19, 2017
1 parent b2ee978 commit 76d61fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def validate_password_archive

# validate is the password used in the past
def password_archive_included?
unless deny_old_passwords.is_a? Fixnum
unless deny_old_passwords.is_a? Integer
if deny_old_passwords.is_a? TrueClass and archive_count > 0
self.deny_old_passwords = archive_count
else
Expand Down
8 changes: 4 additions & 4 deletions lib/devise_security_extension/models/password_expirable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module PasswordExpirable

# is an password change required?
def need_change_password?
if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float
if self.expire_password_after.is_a? Integer or self.expire_password_after.is_a? Float
self.password_changed_at.nil? or self.password_changed_at < self.expire_password_after.seconds.ago
else
false
Expand All @@ -22,15 +22,15 @@ def need_change_password?

# set a fake datetime so a password change is needed and save the record
def need_change_password!
if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float
if self.expire_password_after.is_a? Integer or self.expire_password_after.is_a? Float
need_change_password
self.save(:validate => false)
end
end

# set a fake datetime so a password change is needed
def need_change_password
if self.expire_password_after.is_a? Fixnum or self.expire_password_after.is_a? Float
if self.expire_password_after.is_a? Integer or self.expire_password_after.is_a? Float
self.password_changed_at = self.expire_password_after.seconds.ago
end

Expand All @@ -39,7 +39,7 @@ def need_change_password

self.password_changed_at
end

def expire_password_after
self.class.expire_password_after
end
Expand Down

0 comments on commit 76d61fe

Please sign in to comment.