summaryrefslogtreecommitdiff
path: root/app/models/ml
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-09 15:17:20 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-09 15:17:20 +0000
commit3670ddd229b178c0a2e09a1466ddfd7fd2f7855d (patch)
tree9be2a8155e0b14fb9a07b6a1c8bcfa629af4a25c /app/models/ml
parent0b4adad74b76b34855e9a6d943f9b9188c3914fa (diff)
downloadgitlab-ce-3670ddd229b178c0a2e09a1466ddfd7fd2f7855d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/ml')
-rw-r--r--app/models/ml/candidate.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/ml/candidate.rb b/app/models/ml/candidate.rb
index adf0c26bbc6..6f4728a1d98 100644
--- a/app/models/ml/candidate.rb
+++ b/app/models/ml/candidate.rb
@@ -29,7 +29,7 @@ module Ml
scope: :project,
init: AtomicInternalId.project_init(self, :internal_id)
- scope :including_relationships, -> { includes(:latest_metrics, :params, :user, :package, :project) }
+ scope :including_relationships, -> { includes(:latest_metrics, :params, :user, :package, :project, :ci_build) }
scope :by_name, ->(name) { where("ml_candidates.name LIKE ?", "%#{sanitize_sql_like(name)}%") } # rubocop:disable GitlabSecurity/SqlInjection
scope :order_by_metric, ->(metric, direction) do
@@ -69,6 +69,10 @@ module Ml
iid
end
+ def from_ci?
+ ci_build_id.present?
+ end
+
class << self
def with_project_id_and_eid(project_id, eid)
return unless project_id.present? && eid.present?