diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-02-12 12:24:42 +0000 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-02-28 10:46:20 +0000 |
commit | 4fcbcce36475067f4d72ebe9371634e31073a497 (patch) | |
tree | d5cd9c1ee42e88f5069e25459b4900ad18c21d23 /app/models/cycle_analytics.rb | |
parent | 7c109c575016eb0596e20180b334ca2955bd33e6 (diff) | |
download | gitlab-ce-4fcbcce36475067f4d72ebe9371634e31073a497.tar.gz |
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.rb | 6 |
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 |