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:
@@ -43,9 +43,11 @@ class User < ApplicationRecord
|
||||
|
||||
when_attribute :email_address, :changes_to => :anything do
|
||||
before_save do |was, now|
|
||||
unless self.new_record? && self.email_verified_at
|
||||
self.email_verification_token = rand(999999).to_s.rjust(6, '0')
|
||||
self.email_verified_at = nil
|
||||
end
|
||||
end
|
||||
|
||||
after_commit do |was, new|
|
||||
if self.email_verified_at.nil? && was.present?
|
||||
|
||||
Reference in New Issue
Block a user