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
6d774778
Commit
6d774778
authored
Oct 11, 2018
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove project arg from UpdateService, as un-used
This will help group cluster controller to re-use this service
parent
8b4f2b67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
app/controllers/projects/clusters_controller.rb
app/controllers/projects/clusters_controller.rb
+1
-1
app/services/clusters/update_service.rb
app/services/clusters/update_service.rb
+7
-1
spec/services/clusters/update_service_spec.rb
spec/services/clusters/update_service_spec.rb
+1
-1
No files found.
app/controllers/projects/clusters_controller.rb
View file @
6d774778
...
...
@@ -42,7 +42,7 @@ class Projects::ClustersController < Projects::ApplicationController
def
update
Clusters
::
UpdateService
.
new
(
project
,
current_user
,
update_params
)
.
new
(
current_user
,
update_params
)
.
execute
(
cluster
)
if
cluster
.
valid?
...
...
app/services/clusters/update_service.rb
View file @
6d774778
# frozen_string_literal: true
module
Clusters
class
UpdateService
<
BaseService
class
UpdateService
attr_reader
:current_user
,
:params
def
initialize
(
user
=
nil
,
params
=
{})
@current_user
,
@params
=
user
,
params
.
dup
end
def
execute
(
cluster
)
cluster
.
update
(
params
)
end
...
...
spec/services/clusters/update_service_spec.rb
View file @
6d774778
...
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
Clusters
::
UpdateService
do
describe
'#execute'
do
subject
{
described_class
.
new
(
cluster
.
project
,
cluster
.
user
,
params
).
execute
(
cluster
)
}
subject
{
described_class
.
new
(
cluster
.
user
,
params
).
execute
(
cluster
)
}
let
(
:cluster
)
{
create
(
:cluster
,
:project
,
:provided_by_user
)
}
...
...
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