BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
7f2b6b11
Commit
7f2b6b11
authored
Dec 04, 2017
by
Francisco Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving query to base count service
parent
979056e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
8 deletions
+4
-8
count_service.rb
app/services/projects/count_service.rb
+4
-0
forks_count_service.rb
app/services/projects/forks_count_service.rb
+0
-4
open_issues_count_service.rb
app/services/projects/open_issues_count_service.rb
+0
-4
No files found.
app/services/projects/count_service.rb
View file @
7f2b6b11
...
...
@@ -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
,
...
...
app/services/projects/forks_count_service.rb
View file @
7f2b6b11
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
...
...
app/services/projects/open_issues_count_service.rb
View file @
7f2b6b11
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment