diff --git a/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.rb b/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.rb index 1fbb2c874aa..da1bb8ca48b 100644 --- a/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.rb +++ b/app/components/projects/settings/project_custom_field_sections/custom_field_row_component.rb @@ -51,9 +51,10 @@ module Projects end def active_in_project? - @project_custom_field_project_mappings.any? do |mapping| - mapping.custom_field_id == @project_custom_field.id - end + @project_custom_field.is_for_all? || + @project_custom_field_project_mappings.any? do |mapping| + mapping.custom_field_id == @project_custom_field.id + end end def toggle_path @@ -70,7 +71,7 @@ module Projects end def toggle_enabled? - !@project_custom_field.required? + !@project_custom_field.is_for_all? end def toggle_data_attributes diff --git a/app/models/custom_value.rb b/app/models/custom_value.rb index b9e1e4294d4..cb88fbede6a 100644 --- a/app/models/custom_value.rb +++ b/app/models/custom_value.rb @@ -46,6 +46,7 @@ class CustomValue < ApplicationRecord delegate :editable?, :admin_only?, :required?, + :is_for_all?, :max_length, :min_length, :calculated_value?,