Skip to content

Commit

Permalink
Remove required clause on Projects::CustomFields
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dombesz authored and oliverguenther committed Aug 1, 2024
1 parent 053f7f8 commit 9e66cde
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions app/models/projects/custom_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 9e66cde

Please sign in to comment.