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
Move reset_section_scoped_validations method to Projects::UpdateService
Dombi Attilab392af07827a
diff --git a/app/models/projects/acts_as_customizable_patches.rb b/app/models/projects/acts_as_customizable_patches.rbindex dec980b246f..b6d26e7f8a3 100644--- a/app/models/projects/acts_as_customizable_patches.rb+++ b/app/models/projects/acts_as_customizable_patches.rb@@ -41,14 +41,6 @@ module Projects::ActsAsCustomizablePatchesbefore_update :set_query_available_custom_fields_to_global_level- after_save :reset_section_scoped_validation-- def reset_section_scoped_validation- # reset the section scope after saving- # in order not to silently carry this setting in this instance- self._limit_custom_fields_validation_to_section_id = nil- end-def set_query_available_custom_fields_to_global_level# query the available custom fields on a global level when updating custom field values# in order to support implicit activation of custom fields when values are provided during an updatediff --git a/app/services/projects/update_service.rb b/app/services/projects/update_service.rbindex 573b90ce8fc..3394f75973f 100644--- a/app/services/projects/update_service.rb+++ b/app/services/projects/update_service.rb@@ -47,6 +47,7 @@ module Projectsdef after_perform(service_call)ret = super+ reset_section_scoped_validationtouch_on_custom_values_updatenotify_on_identifier_renamedsend_update_notification@@ -97,5 +98,11 @@ module Projectsservice = service_class.new(user:, model:, contract_class: EmptyContract)service.callend++ def reset_section_scoped_validation+ # reset the section scope after saving+ # in order not to silently carry this setting in this instance+ model._limit_custom_fields_validation_to_section_id = nil+ endendend