debian-mirror-gitlab/app/services/projects/forks_count_service.rb
2018-12-13 13:39:08 +05:30

16 lines
431 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
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