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:
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 8cba3d04502..43427e2ebc7 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -62,6 +62,9 @@ class CommitStatus < Ci::ApplicationRecord
scope :updated_before, ->(lookback:, timeout:) {
where('(ci_builds.created_at BETWEEN ? AND ?) AND (ci_builds.updated_at BETWEEN ? AND ?)', lookback, timeout, lookback, timeout)
}
+ scope :scheduled_at_before, ->(date) {
+ where('ci_builds.scheduled_at IS NOT NULL AND ci_builds.scheduled_at < ?', date)
+ }
# The scope applies `pluck` to split the queries. Use with care.
scope :for_project_paths, -> (paths) do