Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c5a89b35
Commit
c5a89b35
authored
Dec 01, 2017
by
Francisco Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Using map to retrieve the element ids because of some issues with mysql
parent
3dc331c6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
app/services/projects/batch_count_service.rb
app/services/projects/batch_count_service.rb
+3
-2
app/services/projects/batch_forks_count_service.rb
app/services/projects/batch_forks_count_service.rb
+3
-1
app/services/projects/batch_open_issues_count_service.rb
app/services/projects/batch_open_issues_count_service.rb
+3
-1
No files found.
app/services/projects/batch_count_service.rb
View file @
c5a89b35
# Service class for getting and caching the number of elements of several projects
# Warning: do not user this service with a really large set of projects
# because the service use maps to retrieve the project ids.
module
Projects
class
BatchCountService
def
initialize
(
projects
)
...
...
@@ -14,8 +17,6 @@ module Projects
end
def
project_ids
return
@projects
if
@projects
.
is_a?
(
ActiveRecord
::
Relation
)
@projects
.
map
(
&
:id
)
end
...
...
app/services/projects/batch_forks_count_service.rb
View file @
c5a89b35
# Service class for getting and caching the number of forks of several projects
# Warning: do not user this service with a really large set of projects
# because the service use maps to retrieve the project ids
module
Projects
# Service class for getting and caching the number of forks of several projects
class
BatchForksCountService
<
Projects
::
BatchCountService
def
global_count
@global_count
||=
begin
...
...
app/services/projects/batch_open_issues_count_service.rb
View file @
c5a89b35
# Service class for getting and caching the number of issues of several projects
# Warning: do not user this service with a really large set of projects
# because the service use maps to retrieve the project ids
module
Projects
# Service class for getting and caching the number of forks of several projects
class
BatchOpenIssuesCountService
<
Projects
::
BatchCountService
def
global_count
@global_count
||=
begin
...
...
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