Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f17375b9
Commit
f17375b9
authored
Dec 04, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize Clusters::CreateService#execute
parent
6b1ad363
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/controllers/projects/clusters/user_controller.rb
app/controllers/projects/clusters/user_controller.rb
+1
-1
app/services/clusters/create_service.rb
app/services/clusters/create_service.rb
+1
-1
No files found.
app/controllers/projects/clusters/user_controller.rb
View file @
f17375b9
...
@@ -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
)
...
...
app/services/clusters/create_service.rb
View file @
f17375b9
...
@@ -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
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment