chore: upgrade rails to 7.0 and other dependencies

This commit is contained in:
Adam Cooke
2024-02-23 22:51:37 +00:00
committed by Adam Cooke
parent cfc1c9b73e
commit ecd09a2445
27 changed files with 439 additions and 250 deletions
+10 -7
View File
@@ -8,13 +8,7 @@ module HasAuthentication
has_secure_password
validates :password, length: { minimum: 8, allow_blank: true }
when_attribute :password_digest, changes_to: :anything do
before_save do
self.password_reset_token = nil
self.password_reset_token_valid_until = nil
end
end
before_save :clear_password_reset_token_on_password_change
end
class_methods do
@@ -42,6 +36,15 @@ module HasAuthentication
AppMailer.password_reset(self, return_to).deliver
end
private
def clear_password_reset_token_on_password_change
return unless password_digest_changed?
self.password_reset_token = nil
self.password_reset_token_valid_until = nil
end
end
# -*- SkipSchemaAnnotations