diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /app/models/commit_status.rb | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 3 |
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 |