diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 12:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 12:09:13 +0300 |
commit | 1ac794623a8be5dee111716a44dd04ff708f3541 (patch) | |
tree | 6c18f9fbe0bd9978bd3e8d9b083d3a0ca180686e /app/finders/fork_targets_finder.rb | |
parent | 5247fe0bef72fa922841a79d5dbefb47d95112fa (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/finders/fork_targets_finder.rb')
-rw-r--r-- | app/finders/fork_targets_finder.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/finders/fork_targets_finder.rb b/app/finders/fork_targets_finder.rb new file mode 100644 index 00000000000..9003c593757 --- /dev/null +++ b/app/finders/fork_targets_finder.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class ForkTargetsFinder + def initialize(project, user) + @project = project + @user = user + end + + # rubocop: disable CodeReuse/ActiveRecord + def execute + ::Namespace.where(id: user.manageable_namespaces).where.not(id: project.namespace).sort_by_type + end + # rubocop: enable CodeReuse/ActiveRecord + + private + + attr_reader :project, :user +end + +ForkTargetsFinder.prepend_if_ee('EE::ForkTargetsFinder') |