gitlab-org--gitlab-foss/app/services/projects/open_merge_requests_count_service.rb
2018-07-17 15:19:40 -07:00

15 lines
353 B
Ruby

# frozen_string_literal: true
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