Add User#email_domain method to extract domain from email address (#35159)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user