Welcome to mirror list, hosted at ThFree Co, Russian Federation.

forks_count_service.rb « projects « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ca85e2dc2810e2319f1c38d1d972c67192fdf6b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

module Projects
  # Service class for getting and caching the number of forks of a project.
  class ForksCountService < Projects::CountService
    def cache_key_name
      'forks_count'
    end

    # rubocop: disable CodeReuse/ActiveRecord
    def self.query(project_ids)
      ForkNetworkMember.where(forked_from_project: project_ids)
    end
    # rubocop: enable CodeReuse/ActiveRecord
  end
end