Commit 9281e2e4 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'rubocop-performance-openstruct-project-level-stage-adapter' into 'master'

Replace OpenStruct with Struct in project_level_stage_adapter.rb

See merge request gitlab-org/gitlab!59956
parents 530471b5 aef3db7e
......@@ -2726,7 +2726,6 @@ Performance/OpenStruct:
- 'Guardfile'
- 'app/finders/snippets_finder.rb'
- 'app/helpers/application_settings_helper.rb'
- 'app/models/cycle_analytics/project_level_stage_adapter.rb'
- 'ee/lib/gitlab/graphql/aggregations/epics/epic_node.rb'
- 'ee/lib/gitlab/graphql/aggregations/epics/epic_node.rb'
- 'lib/api/wikis.rb'
......
......@@ -4,6 +4,8 @@
# compatible with the old value stream controller actions.
module CycleAnalytics
class ProjectLevelStageAdapter
ProjectLevelStage = Struct.new(:title, :description, :legend, :name, :project_median, keyword_init: true )
def initialize(stage, options)
@stage = stage
@options = options
......@@ -13,7 +15,7 @@ module CycleAnalytics
def as_json(serializer: AnalyticsStageSerializer)
presenter = Analytics::CycleAnalytics::StagePresenter.new(stage)
serializer.new.represent(OpenStruct.new(
serializer.new.represent(ProjectLevelStage.new(
title: presenter.title,
description: presenter.description,
legend: presenter.legend,
......
---
title: Replace OpenStruct with Struct in project_level_stage_adapter.rb
merge_request: 59956
author: Amit Patel @amit.savani
type: performance
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