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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#66093] Use case-in instead of `when Array`
Tobias Dillmanna60fa00f5093
diff --git a/app/models/calculated_values/error_handler.rb b/app/models/calculated_values/error_handler.rbindex 1b84c5fe59e..6a0a82321f6 100644--- a/app/models/calculated_values/error_handler.rb+++ b/app/models/calculated_values/error_handler.rb@@ -86,17 +86,14 @@ module CalculatedValuescustom_field_id = to_id(cf_id)case error- when :zero_division+ in :zero_divisionErrorContext.new(custom_field_id:, error_code: "ERROR_MATHEMATICAL")- when :missing_value+ in :missing_valuebuild_missing_value_error_context(custom_field_id)- when Array- if error.first == :unbound_variable- disabled_fields = error.last.map { to_id(it) }- ErrorContext.new(custom_field_id:, error_code: "ERROR_DISABLED_VALUE", missing_custom_field_ids: disabled_fields)- else- ErrorContext.new(custom_field_id:, error_code: "ERROR_UNKNOWN")- end+ in [:unbound_variable, disabled_fields]+ ErrorContext.new(custom_field_id:,+ error_code: "ERROR_DISABLED_VALUE",+ missing_custom_field_ids: disabled_fields.map { to_id(it) })elseErrorContext.new(custom_field_id:, error_code: "ERROR_UNKNOWN")end