mirror of
https://github.com/postalserver/postal.git
synced 2026-10-19 10:46:32 +00:00
when a new user is added with a verified timestamp, don't just clear it
This commit is contained in:
+4
-2
@@ -43,8 +43,10 @@ class User < ApplicationRecord
|
|||||||
|
|
||||||
when_attribute :email_address, :changes_to => :anything do
|
when_attribute :email_address, :changes_to => :anything do
|
||||||
before_save do |was, now|
|
before_save do |was, now|
|
||||||
self.email_verification_token = rand(999999).to_s.rjust(6, '0')
|
unless self.new_record? && self.email_verified_at
|
||||||
self.email_verified_at = nil
|
self.email_verification_token = rand(999999).to_s.rjust(6, '0')
|
||||||
|
self.email_verified_at = nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
after_commit do |was, new|
|
after_commit do |was, new|
|
||||||
|
|||||||
Reference in New Issue
Block a user