Commit f17375b9 authored by Shinya Maeda's avatar Shinya Maeda

Optimize Clusters::CreateService#execute

parent 6b1ad363
...@@ -11,7 +11,7 @@ class Projects::Clusters::UserController < Projects::ApplicationController ...@@ -11,7 +11,7 @@ class Projects::Clusters::UserController < Projects::ApplicationController
def create def create
@cluster = ::Clusters::CreateService @cluster = ::Clusters::CreateService
.new(project, current_user, create_params) .new(project, current_user, create_params)
.execute(nil) .execute
if @cluster.persisted? if @cluster.persisted?
redirect_to project_cluster_path(project, @cluster) redirect_to project_cluster_path(project, @cluster)
......
...@@ -2,7 +2,7 @@ module Clusters ...@@ -2,7 +2,7 @@ module Clusters
class CreateService < BaseService class CreateService < BaseService
attr_reader :access_token attr_reader :access_token
def execute(access_token) def execute(access_token = nil)
@access_token = access_token @access_token = access_token
create_cluster.tap do |cluster| create_cluster.tap do |cluster|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment