1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

chore: upgrade rails to 7.0 and other dependencies

هذا الالتزام موجود في:
Adam Cooke
2024-02-23 14:24:17 +00:00
ملتزم من قبل Adam Cooke
الأصل cfc1c9b73e
التزام ecd09a2445
27 ملفات معدلة مع 439 إضافات و250 حذوفات

عرض الملف

@@ -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