2020-02-20 04:09:13 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class ForkTargetsFinder
|
|
|
|
def initialize(project, user)
|
|
|
|
@project = project
|
|
|
|
@user = user
|
|
|
|
end
|
|
|
|
|
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
|
|
def execute
|
2020-03-03 13:08:16 -05:00
|
|
|
::Namespace.where(id: user.manageable_namespaces).sort_by_type
|
2020-02-20 04:09:13 -05:00
|
|
|
end
|
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
attr_reader :project, :user
|
|
|
|
end
|
|
|
|
|
|
|
|
ForkTargetsFinder.prepend_if_ee('EE::ForkTargetsFinder')
|