Skip to content

Instantly share code, notes, and snippets.

@staycreativedesign
Created July 31, 2017 17:18
Show Gist options
  • Save staycreativedesign/4e1e6927615caa9651eccc5eca36b601 to your computer and use it in GitHub Desktop.
Save staycreativedesign/4e1e6927615caa9651eccc5eca36b601 to your computer and use it in GitHub Desktop.
class CreateUser
def initialize(params)
@user = params[:user]
end
def run!
create_user
end
private
def user_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :team_id, :phone_number, :birthday, :business_industry_id, :business_category_id)
end
def create_user
User.create(
first_name: @user[:first_name],
middle_name: @user[:middle_name],
last_name: @user[:last_name],
email: @user[:email],
password: @user[:password]
)
end
e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment