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 Method Summary collapse

Methods inherited from CountService

#cache_key, #initialize, query

Methods inherited from BaseCountService

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

Constructor Details

This class inherits a constructor from Projects::CountService

Instance Method Details

#cache_key_nameObject


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

def cache_key_name
  'open_merge_requests_count'
end

#relation_for_countObject


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

def relation_for_count
  @project.merge_requests.opened
end