2018-11-18 11:00:15 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
module Projects
|
|
|
|
# Service class for counting and caching the number of open merge requests of
|
|
|
|
# a project.
|
|
|
|
class OpenMergeRequestsCountService < Projects::CountService
|
|
|
|
def relation_for_count
|
|
|
|
@project.merge_requests.opened
|
|
|
|
end
|
|
|
|
|
|
|
|
def cache_key_name
|
|
|
|
'open_merge_requests_count'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|