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>2020-01-29 12:08:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-29 12:08:49 +0300
commit46b10c0fc884400941c17e2777b242ac54d111e5 (patch)
tree184bc49764f03791610c8ae716c03e0100ed45f5 /app/models
parent3358e1fdb8fe1e8f739024ee4f3d1071b296a010 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index b2de2b32ae0..f8c201d73e5 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -453,6 +453,9 @@ class Project < ApplicationRecord
scope :with_issues_enabled, -> { with_feature_enabled(:issues) }
scope :with_issues_available_for_user, ->(current_user) { with_feature_available_for_user(:issues, current_user) }
scope :with_merge_requests_available_for_user, ->(current_user) { with_feature_available_for_user(:merge_requests, current_user) }
+ scope :with_issues_or_mrs_available_for_user, -> (user) do
+ with_issues_available_for_user(user).or(with_merge_requests_available_for_user(user))
+ end
scope :with_merge_requests_enabled, -> { with_feature_enabled(:merge_requests) }
scope :with_remote_mirrors, -> { joins(:remote_mirrors).where(remote_mirrors: { enabled: true }).distinct }
scope :with_limit, -> (maximum) { limit(maximum) }