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] Move error record creation into the ErrorContext class
Tobias Dillmann80875f01b77c
diff --git a/app/models/calculated_values/error_handler.rb b/app/models/calculated_values/error_handler.rbindex b0a28d6f85a..93f45658c06 100644--- a/app/models/calculated_values/error_handler.rb+++ b/app/models/calculated_values/error_handler.rb@@ -38,6 +38,15 @@ module CalculatedValues@error_code = error_code@missing_custom_field_ids = missing_custom_field_idsend++ def create_calculated_value_error!(customized)+ CalculatedValueError.create(+ customized:,+ custom_field_id:,+ error_code:,+ missing_custom_field_ids:+ )+ endenddef self.handle_calculation_errors(customized, calculation_result, given_values, calculated_fields)@@ -122,23 +131,10 @@ module CalculatedValuesdef create_error_records!(error_contexts)error_contexts.each do |context|- create_calculated_value_error!(- context.custom_field_id,- context.error_code,- context.missing_custom_field_ids- )+ context.create_calculated_value_error!(customized)endend- def create_calculated_value_error!(custom_field_id, error_code, missing_custom_field_ids = [])- CalculatedValueError.create(- customized:,- custom_field_id:,- error_code:,- missing_custom_field_ids:- )- end-def to_id(cf_id)cf_id.sub("cf_", "").to_iend