summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-05-02 21:20:49 +1200
committerThong Kuah <tkuah@gitlab.com>2019-07-08 10:04:33 +1200
commit492e188b9436227edd5041506eedca88de28ac9d (patch)
tree6ababab9c03518f464c9a27affa7546e7d5e43ea
parentd2d042f387a9f46da210712d1f1a5b3145f26485 (diff)
downloadgitlab-ce-support-cluster-choosing-project.tar.gz
Removes delegate to Cluster#projectsupport-cluster-choosing-project
With group and project (and soon instace) level clusters, the Cluster#project method does not make sense anymore, so use Cluster#first_project instead. Ditto for Cluster#group
-rw-r--r--app/models/clusters/applications/runner.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb
index f0256ff4d41..69d70044021 100644
--- a/app/models/clusters/applications/runner.rb
+++ b/app/models/clusters/applications/runner.rb
@@ -13,7 +13,6 @@ module Clusters
include ::Clusters::Concerns::ApplicationData
belongs_to :runner, class_name: 'Ci::Runner', foreign_key: :runner_id
- delegate :project, :group, to: :cluster
default_value_for :version, VERSION
@@ -69,9 +68,9 @@ module Clusters
}
if cluster.group_type?
- attributes[:groups] = [group]
+ attributes[:groups] = [cluster.first_group]
elsif cluster.project_type?
- attributes[:projects] = [project]
+ attributes[:projects] = [cluster.first_project]
end
attributes