Class: Projects::BatchForksCountService

Inherits:
BatchCountService show all
Defined in:
app/services/projects/batch_forks_count_service.rb

Instance Method Summary collapse

Methods inherited from BatchCountService

#initialize, #project_ids, #refresh_cache_and_retrieve_data

Constructor Details

This class inherits a constructor from Projects::BatchCountService

Instance Method Details

#count_serviceObject

rubocop: enable CodeReuse/ActiveRecord


18
19
20
# File 'app/services/projects/batch_forks_count_service.rb', line 18

def count_service
  ::Projects::ForksCountService
end

#global_countObject

rubocop: disable CodeReuse/ActiveRecord


9
10
11
12
13
14
15
# File 'app/services/projects/batch_forks_count_service.rb', line 9

def global_count
  @global_count ||= begin
    count_service.query(project_ids)
                 .group(:forked_from_project_id)
                 .count
  end
end