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>2021-02-22 18:10:48 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-22 18:10:48 +0300
commit232e7582b0e81e95bd721ad8094fcb50ecbc8a04 (patch)
treea68e00760d0a3446c2030addd679b33acfa39d2d /app/finders/merge_request_target_project_finder.rb
parent980d813e90c70f09861e39b9269e73b2c9a4e936 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders/merge_request_target_project_finder.rb')
-rw-r--r--app/finders/merge_request_target_project_finder.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/finders/merge_request_target_project_finder.rb b/app/finders/merge_request_target_project_finder.rb
index 85a73e0c6ff..dc9b28ab0a0 100644
--- a/app/finders/merge_request_target_project_finder.rb
+++ b/app/finders/merge_request_target_project_finder.rb
@@ -5,29 +5,30 @@ class MergeRequestTargetProjectFinder
attr_reader :current_user, :source_project
- def initialize(current_user: nil, source_project:)
+ def initialize(current_user: nil, source_project:, project_feature: :merge_requests)
@current_user = current_user
@source_project = source_project
+ @project_feature = project_feature
end
- # rubocop: disable CodeReuse/ActiveRecord
def execute(include_routes: false)
if source_project.fork_network
include_routes ? projects.inc_routes : projects
else
- Project.where(id: source_project)
+ Project.id_in(source_project.id)
end
end
- # rubocop: enable CodeReuse/ActiveRecord
private
+ attr_reader :project_feature
+
def projects
source_project
.fork_network
.projects
.public_or_visible_to_user(current_user)
.non_archived
- .with_feature_available_for_user(:merge_requests, current_user)
+ .with_feature_available_for_user(project_feature, current_user)
end
end