Skip to content

Commit

Permalink
Try #3
Browse files Browse the repository at this point in the history
  • Loading branch information
dombesz committed May 30, 2024
1 parent 3f3a2aa commit 8ef8df2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/models/projects/acts_as_customizable_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ def available_custom_fields(global: false)
# hidden fields, they will be cleared from the association. The `custom_field_values` will contain the
# hidden fields, only if they are returned from this method. Hence we should not hide them,
# when accessed with the _query_available_custom_fields_on_global_level flag on.
unless _query_available_custom_fields_on_global_level
custom_fields = custom_fields.visible
end
custom_fields = custom_fields.visible

# available_custom_fields is called from within the acts_as_customizable module
# we don't want to adjust these calls, but need a way to query the available custom fields on a global level in some cases
Expand All @@ -149,7 +147,7 @@ def available_custom_fields(global: false)
#
# additionally we provide the `global` parameter to allow querying the available custom fields on a global level
# when we have explicit control over the call of `available_custom_fields`
unless global || new_record? || _query_available_custom_fields_on_global_level
unless global || new_record?
custom_fields = custom_fields
.where(id: project_custom_field_project_mappings.select(:custom_field_id))
.or(ProjectCustomField.required)
Expand Down

0 comments on commit 8ef8df2

Please sign in to comment.