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 collapse

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

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project


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

def project
  @project
end

Class Method Details

.query(project_ids) ⇒ Object

rubocop: disable CodeReuse/ActiveRecord


13
14
15
# File 'app/services/projects/forks_count_service.rb', line 13

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

Instance Method Details

#cache_key_nameObject


8
9
10
# File 'app/services/projects/forks_count_service.rb', line 8

def cache_key_name
  'forks_count'
end