From 9e66cde27835444ef7f521d0b119fea6feeda4aa Mon Sep 17 00:00:00 2001 From: Dombi Attila <83396+dombesz@users.noreply.github.com> Date: Thu, 1 Aug 2024 10:58:15 +0300 Subject: [PATCH] Remove required clause on Projects::CustomFields It is not necessary anymore, because the required fields are already returned in the project mapping clause, because required custom fields also have a read-only mapping created. --- app/models/projects/custom_fields.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/models/projects/custom_fields.rb b/app/models/projects/custom_fields.rb index c939af9fb101..f53e0f8ba0d8 100644 --- a/app/models/projects/custom_fields.rb +++ b/app/models/projects/custom_fields.rb @@ -42,7 +42,6 @@ def available_custom_fields return all_visible_custom_fields if new_record? all_visible_custom_fields.where(id: project_custom_field_project_mappings.select(:custom_field_id)) - .or(required_visible_custom_fields) end # Note: @@ -64,10 +63,6 @@ def all_visible_custom_fields all_available_custom_fields.visible(project: self) end - def required_visible_custom_fields - ProjectCustomField.required.visible(project: self) - end - def custom_field_values_to_validate # Limit the set of available custom fields when the validation is limited to a section if _limit_custom_fields_validation_to_section_id