group_service.rb 424 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4 5 6 7 8 9
module Search
  class GroupService < Search::GlobalService
    attr_accessor :group

    def initialize(user, group, params)
      super(user, params)

10
      @default_project_filter = false
11 12 13 14 15 16 17 18 19 20 21
      @group = group
    end

    def projects
      return Project.none unless group
      return @projects if defined? @projects

      @projects = super.inside_path(group.full_path)
    end
  end
end