Commit 69a452c8 authored by Kerri Miller's avatar Kerri Miller

Merge branch 'issue_324629_metadatable' into 'master'

Fix Gitlab/DelegatePredicateMethods offenses

See merge request gitlab-org/gitlab!76001
parents 77e6ac79 71263ab9
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
Gitlab/DelegatePredicateMethods: Gitlab/DelegatePredicateMethods:
Exclude: Exclude:
- app/models/clusters/cluster.rb - app/models/clusters/cluster.rb
- app/models/concerns/ci/metadatable.rb
- app/models/concerns/integrations/base_data_fields.rb - app/models/concerns/integrations/base_data_fields.rb
- app/models/project.rb - app/models/project.rb
- ee/app/models/concerns/ee/ci/metadatable.rb - ee/app/models/concerns/ee/ci/metadatable.rb
......
...@@ -18,13 +18,19 @@ module Ci ...@@ -18,13 +18,19 @@ module Ci
delegate :timeout, to: :metadata, prefix: true, allow_nil: true delegate :timeout, to: :metadata, prefix: true, allow_nil: true
delegate :interruptible, to: :metadata, prefix: false, allow_nil: true delegate :interruptible, to: :metadata, prefix: false, allow_nil: true
delegate :has_exposed_artifacts?, to: :metadata, prefix: false, allow_nil: true
delegate :environment_auto_stop_in, to: :metadata, prefix: false, allow_nil: true delegate :environment_auto_stop_in, to: :metadata, prefix: false, allow_nil: true
delegate :set_cancel_gracefully, to: :metadata, prefix: false, allow_nil: false delegate :set_cancel_gracefully, to: :metadata, prefix: false, allow_nil: false
delegate :cancel_gracefully?, to: :metadata, prefix: false, allow_nil: false
before_create :ensure_metadata before_create :ensure_metadata
end end
def has_exposed_artifacts?
!!metadata&.has_exposed_artifacts?
end
def cancel_gracefully?
!!metadata&.cancel_gracefully?
end
def ensure_metadata def ensure_metadata
metadata || build_metadata(project: project) metadata || build_metadata(project: project)
end end
......
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