Commit c5a89b35 authored by Francisco Lopez's avatar Francisco Lopez

Using map to retrieve the element ids because of some issues with mysql

parent 3dc331c6
# 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
......
# 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
......
# 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment