summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects/cycle_analytics_controller.rb4
-rw-r--r--app/models/cycle_analytics.rb7
2 files changed, 5 insertions, 6 deletions
diff --git a/app/controllers/projects/cycle_analytics_controller.rb b/app/controllers/projects/cycle_analytics_controller.rb
index 8567b074f11..00ecdcbd1b9 100644
--- a/app/controllers/projects/cycle_analytics_controller.rb
+++ b/app/controllers/projects/cycle_analytics_controller.rb
@@ -6,7 +6,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
before_action :authorize_read_cycle_analytics!
def show
- @cycle_analytics = ::CycleAnalytics.new(@project, from: start_date(cycle_analytics_params), user: current_user)
+ @cycle_analytics = ::CycleAnalytics.new(@project, from: start_date(cycle_analytics_params))
respond_to do |format|
format.html
@@ -55,7 +55,7 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
{
summary: summary,
stats: stats,
- permissions: @cycle_analytics.permissions
+ permissions: @cycle_analytics.permissions(user: current_user)
}
end
end
diff --git a/app/models/cycle_analytics.rb b/app/models/cycle_analytics.rb
index a10e96d53bf..cb8e088d21d 100644
--- a/app/models/cycle_analytics.rb
+++ b/app/models/cycle_analytics.rb
@@ -1,10 +1,9 @@
class CycleAnalytics
STAGES = %i[issue plan code test review staging production].freeze
- def initialize(project, from:, user:)
+ def initialize(project, from:)
@project = project
@from = from
- @user = user
@fetcher = Gitlab::CycleAnalytics::MetricsFetcher.new(project: project, from: from, branch: nil)
end
@@ -12,8 +11,8 @@ class CycleAnalytics
@summary ||= Summary.new(@project, from: @from)
end
- def permissions
- Gitlab::CycleAnalytics::Permissions.get(user: @user, project: @project)
+ def permissions(user:)
+ Gitlab::CycleAnalytics::Permissions.get(user: user, project: @project)
end
def issue