Class: Projects::OpenMergeRequestsCountService

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

Overview

Service class for counting and caching the number of open merge requests 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



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

def self.query(project_ids)
  MergeRequest.opened.of_projects(project_ids)
end

Instance Method Details

#cache_key_nameObject



7
8
9
# File 'app/services/projects/open_merge_requests_count_service.rb', line 7

def cache_key_name
  'open_merge_requests_count'
end