Skip to content
Snippets Groups Projects
Commit 7f2b6b11 authored by Francisco Javier López's avatar Francisco Javier López
Browse files

Moving query to base count service

parent 979056e9
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -11,6 +11,10 @@ module Projects
@project = project
end
 
def relation_for_count
self.class.query(@project.id)
end
def cache_key_name
raise(
NotImplementedError,
Loading
Loading
module Projects
# Service class for getting and caching the number of forks of a project.
class ForksCountService < Projects::CountService
def relation_for_count
self.class.query(@project.id)
end
def cache_key_name
'forks_count'
end
Loading
Loading
Loading
Loading
@@ -2,10 +2,6 @@ module Projects
# Service class for counting and caching the number of open issues of a
# project.
class OpenIssuesCountService < Projects::CountService
def relation_for_count
self.class.query(@project.id)
end
def cache_key_name
'open_issues_count'
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment