feat: Add full name to the user signup form (#1534)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
class AccountBuilder
|
||||
include CustomExceptions::Account
|
||||
pattr_initialize [:account_name!, :email!, :confirmed!, :user]
|
||||
pattr_initialize [:account_name!, :email!, :confirmed!, :user, :user_full_name]
|
||||
|
||||
def perform
|
||||
if @user.nil?
|
||||
@@ -60,18 +60,13 @@ class AccountBuilder
|
||||
)
|
||||
end
|
||||
|
||||
def email_to_name(email)
|
||||
name = email[/[^@]+/]
|
||||
name.split('.').map(&:capitalize).join(' ')
|
||||
end
|
||||
|
||||
def create_user
|
||||
password = SecureRandom.alphanumeric(12)
|
||||
|
||||
@user = User.new(email: @email,
|
||||
password: password,
|
||||
password_confirmation: password,
|
||||
name: email_to_name(@email))
|
||||
name: @user_full_name)
|
||||
@user.confirm if @confirmed
|
||||
@user.save!
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user