diff options
Diffstat (limited to 'app/models/ci/runner.rb')
-rw-r--r-- | app/models/ci/runner.rb | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 6c3754d84d0..28d9edcc135 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -8,15 +8,12 @@ module Ci include ChronicDurationAttribute include FromUnion include TokenAuthenticatable - include IgnorableColumns include FeatureGate include Gitlab::Utils::StrongMemoize include TaggableQueries include Presentable include EachBatch - ignore_column :semver, remove_with: '15.4', remove_after: '2022-08-22' - add_authentication_token_field :token, encrypted: :optional, expires_at: :compute_token_expiration, expiration_enforced?: :token_expiration_enforced? enum access_level: { @@ -351,6 +348,12 @@ module Ci end end + def owner_project + return unless project_type? + + runner_projects.order(:id).first.project + end + def belongs_to_one_project? runner_projects.count == 1 end @@ -359,14 +362,6 @@ module Ci runner_projects.limit(2).count(:all) > 1 end - def assigned_to_group? - runner_namespaces.any? - end - - def assigned_to_project? - runner_projects.any? - end - def match_build_if_online?(build) active? && online? && matches_build?(build) end |