2018-07-17 12:50:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-17 11:21:25 -04:00
|
|
|
module Projects
|
|
|
|
# Service class for counting and caching the number of open merge requests of
|
|
|
|
# a project.
|
2017-11-15 09:47:10 -05:00
|
|
|
class OpenMergeRequestsCountService < Projects::CountService
|
2017-08-17 11:21:25 -04:00
|
|
|
def relation_for_count
|
|
|
|
@project.merge_requests.opened
|
|
|
|
end
|
|
|
|
|
|
|
|
def cache_key_name
|
|
|
|
'open_merge_requests_count'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|