gitlab-org--gitlab-foss/app/services/search/group_service.rb
Yorick Peterse 2039c8280d
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
2018-09-11 17:32:00 +02:00

23 lines
515 B
Ruby

# frozen_string_literal: true
module Search
class GroupService < Search::GlobalService
attr_accessor :group
def initialize(user, group, params)
super(user, params)
@default_project_filter = false
@group = group
end
# rubocop: disable CodeReuse/ActiveRecord
def projects
return Project.none unless group
return @projects if defined? @projects
@projects = super.inside_path(group.full_path)
end
# rubocop: enable CodeReuse/ActiveRecord
end
end