Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-02-12 15:24:42 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-02-28 13:46:20 +0300
commit4fcbcce36475067f4d72ebe9371634e31073a497 (patch)
treed5cd9c1ee42e88f5069e25459b4900ad18c21d23 /app/models/cycle_analytics.rb
parent7c109c575016eb0596e20180b334ca2955bd33e6 (diff)
Add BatchLoader as a way to refactor the base stage code
Diffstat (limited to 'app/models/cycle_analytics.rb')
-rw-r--r--app/models/cycle_analytics.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/cycle_analytics.rb b/app/models/cycle_analytics.rb
index c7f0e5f5cd8..52eb07ae7d6 100644
--- a/app/models/cycle_analytics.rb
+++ b/app/models/cycle_analytics.rb
@@ -6,9 +6,9 @@ class CycleAnalytics
@options = options
end
- def self.all_medians_per_stage(projects, options)
+ def all_medians_per_stage
STAGES.each_with_object({}) do |stage_name, hsh|
- hsh[stage_name] = Gitlab::CycleAnalytics::Stage[stage_name].new(projects: projects, options: options).medians&.values || []
+ hsh[stage_name] = self[stage_name].median
end
end
@@ -31,7 +31,7 @@ class CycleAnalytics
end
def [](stage_name)
- Gitlab::CycleAnalytics::Stage[stage_name].new(projects: [@project], options: @options)
+ Gitlab::CycleAnalytics::Stage[stage_name].new(project: @project, options: @options)
end
private