Optimize Clusters::CreateService#execute

This commit is contained in:
Shinya Maeda 2017-12-04 22:18:58 +09:00
parent 6b1ad363dc
commit f17375b9d0
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ class Projects::Clusters::UserController < Projects::ApplicationController
def create
@cluster = ::Clusters::CreateService
.new(project, current_user, create_params)
.execute(nil)
.execute
if @cluster.persisted?
redirect_to project_cluster_path(project, @cluster)

View File

@ -2,7 +2,7 @@ module Clusters
class CreateService < BaseService
attr_reader :access_token
def execute(access_token)
def execute(access_token = nil)
@access_token = access_token
create_cluster.tap do |cluster|