summaryrefslogtreecommitdiff
path: root/app/models/cycle_analytics.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-11-23 11:28:28 +0100
committerJames Lopez <james@jameslopez.es>2017-01-17 11:32:55 +0100
commita67311cb4c9f54af43d300fde5240f9a370193d1 (patch)
tree14b82a6181b6cd7a148eeda9d2e50002c798dd8e /app/models/cycle_analytics.rb
parent02e1e4819234662faddd7d8eb5c54d9bfdf9e7e6 (diff)
downloadgitlab-ce-a67311cb4c9f54af43d300fde5240f9a370193d1.tar.gz
Fix other spec failures
Diffstat (limited to 'app/models/cycle_analytics.rb')
-rw-r--r--app/models/cycle_analytics.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/models/cycle_analytics.rb b/app/models/cycle_analytics.rb
index 00e9f7c7d5c..5bcc6fa1954 100644
--- a/app/models/cycle_analytics.rb
+++ b/app/models/cycle_analytics.rb
@@ -7,7 +7,7 @@ class CycleAnalytics
end
def summary
- @summary ||= Gitlab::CycleAnalytics::Summary.new(@project, from: @options[:from]).data
+ @summary ||= ::Gitlab::CycleAnalytics::StageSummary.new(@project, from: @options[:from]).data
end
def stats
@@ -15,23 +15,26 @@ class CycleAnalytics
end
def no_stats?
- stats.map(&:value).compact.empty?
+ stats.map { |hash| hash[:value] }.compact.empty?
end
def permissions(user:)
Gitlab::CycleAnalytics::Permissions.get(user: user, project: @project)
end
+ def events_for(stage)
+ classify_stage(stage).new(project: @project, options: @options, stage: stage).events
+ end
+
private
def stats_per_stage
STAGES.map do |stage_name|
- classify_stage(method_sym).new(project: @project, options: @options, stage: stage_name).median_data
+ classify_stage(stage_name).new(project: @project, options: @options, stage: stage_name).median_data
end
end
def classify_stage(stage_name)
"Gitlab::CycleAnalytics::#{stage_name.to_s.capitalize}Stage".constantize
end
-
end