diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 00:08:09 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-18 00:08:09 +0000 |
commit | 2a65a97e12a0754b9f0d91ee996a6e61e00c80c8 (patch) | |
tree | f439c93cc95a324ba7422b0b650431a628be9b07 /app/models/commit_status.rb | |
parent | 2d96e61ceb1a3f26283dfba43f85d99488752296 (diff) | |
download | gitlab-ce-2a65a97e12a0754b9f0d91ee996a6e61e00c80c8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 4929c773eb8..8d38835fb3b 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -47,6 +47,12 @@ class CommitStatus < ApplicationRecord scope :after_stage, -> (index) { where('stage_idx > ?', index) } scope :processables, -> { where(type: %w[Ci::Build Ci::Bridge]) } scope :for_ids, -> (ids) { where(id: ids) } + scope :for_ref, -> (ref) { where(ref: ref) } + scope :by_name, -> (name) { where(name: name) } + + scope :for_project_paths, -> (paths) do + where(project: Project.where_full_path_in(Array(paths))) + end scope :with_preloads, -> do preload(:project, :user) |