Created
July 31, 2017 17:18
-
-
Save staycreativedesign/4e1e6927615caa9651eccc5eca36b601 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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