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

Update Fixnum to Integer, complies with Ruby 2.4 #238

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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