From 492e188b9436227edd5041506eedca88de28ac9d Mon Sep 17 00:00:00 2001 From: Thong Kuah Date: Thu, 2 May 2019 21:20:49 +1200 Subject: Removes delegate to Cluster#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 --- app/models/clusters/applications/runner.rb | 5 ++--- 1 file 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 -- cgit v1.2.1