debian-mirror-gitlab/app/services/projects/forks_count_service.rb
2020-08-09 17:41:57 +05:30

18 lines
457 B
Ruby

# frozen_string_literal: true
module Projects
# Service class for getting and caching the number of forks of a project.
class ForksCountService < Projects::CountService
attr_reader :project
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