Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2024-01-16 13:42:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-16 13:42:19 +0300
commit84d1bd786125c1c14a3ba5f63e38a4cc736a9027 (patch)
treef550fa965f507077e20dbb6d61a8269a99ef7107 /app/models/ml/experiment.rb
parent3a105e36e689f7b75482236712f1a47fd5a76814 (diff)
Add latest changes from gitlab-org/gitlab@16-8-stable-eev16.8.0-rc42
Diffstat (limited to 'app/models/ml/experiment.rb')
-rw-r--r--app/models/ml/experiment.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/ml/experiment.rb b/app/models/ml/experiment.rb
index ad6c6b7b3bf..456c23df0e0 100644
--- a/app/models/ml/experiment.rb
+++ b/app/models/ml/experiment.rb
@@ -3,6 +3,7 @@
module Ml
class Experiment < ApplicationRecord
include AtomicInternalId
+ include Sortable
PACKAGE_PREFIX = 'ml_experiment_'
@@ -15,6 +16,8 @@ module Ml
has_many :candidates, class_name: 'Ml::Candidate'
has_many :metadata, class_name: 'Ml::ExperimentMetadata'
+ scope :including_project, -> { includes(:project) }
+ scope :by_project, ->(project) { where(project: project) }
scope :with_candidate_count, -> {
left_outer_joins(:candidates)
.select("ml_experiments.*, count(ml_candidates.id) as candidate_count")