2
0

Add User#email_domain method to extract domain from email address (#35159)

This commit is contained in:
Matt Jankowski
2025-06-25 03:22:19 -04:00
committed by GitHub
parent 8ba1487f30
commit f852da50f6
5 changed files with 38 additions and 3 deletions

View File

@@ -223,6 +223,12 @@ class User < ApplicationRecord
end
end
def email_domain
Mail::Address.new(email).domain
rescue Mail::Field::ParseError
nil
end
def update_sign_in!(new_sign_in: false)
old_current = current_sign_in_at
new_current = Time.now.utc