mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
[#69399] project custom field section: for_all controls the toggle
This commit is contained in:
+5
-4
@@ -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
|
||||
|
||||
@@ -46,6 +46,7 @@ class CustomValue < ApplicationRecord
|
||||
delegate :editable?,
|
||||
:admin_only?,
|
||||
:required?,
|
||||
:is_for_all?,
|
||||
:max_length,
|
||||
:min_length,
|
||||
:calculated_value?,
|
||||
|
||||
Reference in New Issue
Block a user