Class: Projects::ForksCountService

Inherits:
CountService show all
Defined in:
app/services/projects/forks_count_service.rb

Overview

Service class for getting and caching the number of forks of a project.

Constant Summary

Constants inherited from CountService

CountService::VERSION

Instance Attribute Summary

Attributes inherited from CountService

#project

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CountService

#cache_key, #initialize, #relation_for_count

Methods inherited from BaseCountService

#cache_key, #cache_options, #count, #count_stored?, #delete_cache, #raw?, #refresh_cache, #relation_for_count, #uncached_count, #update_cache_for_key

Constructor Details

This class inherits a constructor from Projects::CountService

Class Method Details

.query(project_ids) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord



11
12
13
# File 'app/services/projects/forks_count_service.rb', line 11

def self.query(project_ids)
  ForkNetworkMember.where(forked_from_project: project_ids)
end

Instance Method Details

#cache_key_nameObject



6
7
8
# File 'app/services/projects/forks_count_service.rb', line 6

def cache_key_name
  'forks_count'
end