diff options
Diffstat (limited to 'app/models/ci')
-rw-r--r-- | app/models/ci/runner.rb | 6 | ||||
-rw-r--r-- | app/models/ci/runner_group.rb | 8 | ||||
-rw-r--r-- | app/models/ci/runner_namespace.rb | 9 |
3 files changed, 12 insertions, 11 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 4d4aff4c830..0b47b71a267 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -14,8 +14,8 @@ module Ci has_many :builds has_many :runner_projects, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :projects, through: :runner_projects - has_many :runner_groups - has_many :groups, through: :runner_groups + has_many :runner_namespaces + has_many :groups, through: :runner_namespaces has_one :last_build, ->() { order('id DESC') }, class_name: 'Ci::Build' @@ -144,7 +144,7 @@ module Ci end def assigned_to_group? - runner_groups.any? + runner_namespaces.any? end def assigned_to_project? diff --git a/app/models/ci/runner_group.rb b/app/models/ci/runner_group.rb deleted file mode 100644 index 87f3ba13bff..00000000000 --- a/app/models/ci/runner_group.rb +++ /dev/null @@ -1,8 +0,0 @@ -module Ci - class RunnerGroup < ActiveRecord::Base - extend Gitlab::Ci::Model - - belongs_to :runner - belongs_to :group, class_name: '::Group' - end -end diff --git a/app/models/ci/runner_namespace.rb b/app/models/ci/runner_namespace.rb new file mode 100644 index 00000000000..3269f86e8ca --- /dev/null +++ b/app/models/ci/runner_namespace.rb @@ -0,0 +1,9 @@ +module Ci + class RunnerNamespace < ActiveRecord::Base + extend Gitlab::Ci::Model + + belongs_to :runner + belongs_to :namespace, class_name: '::Namespace' + belongs_to :group, class_name: '::Group', foreign_key: :namespace_id + end +end |