summaryrefslogtreecommitdiff
path: root/app/models/concerns/ci/has_deployment_name.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/ci/has_deployment_name.rb')
-rw-r--r--app/models/concerns/ci/has_deployment_name.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/models/concerns/ci/has_deployment_name.rb b/app/models/concerns/ci/has_deployment_name.rb
new file mode 100644
index 00000000000..fe288134872
--- /dev/null
+++ b/app/models/concerns/ci/has_deployment_name.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+module Ci
+ module HasDeploymentName
+ extend ActiveSupport::Concern
+
+ def count_user_deployment?
+ Feature.enabled?(:job_deployment_count) && deployment_name?
+ end
+
+ def deployment_name?
+ self.class::DEPLOYMENT_NAMES.any? { |n| name.downcase.include?(n) }
+ end
+ end
+end