Commit 6d774778 authored by Thong Kuah's avatar Thong Kuah

Remove project arg from UpdateService, as un-used

This will help group cluster controller to re-use this service
parent 8b4f2b67
......@@ -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?
......
# 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
......
......@@ -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) }
......
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