Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

be strict about Projects::Phases::HoverCardComponent initializer gate argument

Ivan Kuchina5f582d74680
diff --git a/app/components/projects/phases/hover_card_component.rb b/app/components/projects/phases/hover_card_component.rb
index 8fbb12359a4..8175f832a04 100644
--- a/app/components/projects/phases/hover_card_component.rb
+++ b/app/components/projects/phases/hover_card_component.rb
@@ -35,7 +35,9 @@ module Projects
attr_reader :phase
- def initialize(id:, gate: "start")
+ def initialize(id:, gate:)
+ raise ArgumentError, "gate must be either 'start' or 'finish'" unless %w[start finish].include?(gate)
+
super
@phase = Project::Phase