2039c8280d
This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
19 lines
638 B
Ruby
19 lines
638 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)
|
|
# We can't directly change ForkedProjectLink to ForkNetworkMember here
|
|
# Nowadays, when a call using v3 to projects/:id/fork is made,
|
|
# the relationship to ForkNetworkMember is not updated
|
|
ForkedProjectLink.where(forked_from_project: project_ids)
|
|
end
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
end
|
|
end
|