diff --git a/app/models/queries/projects/filters/custom_field_filter.rb b/app/models/queries/projects/filters/custom_field_filter.rb index 9cf94b96b2..8d8e5132be 100644 --- a/app/models/queries/projects/filters/custom_field_filter.rb +++ b/app/models/queries/projects/filters/custom_field_filter.rb @@ -53,7 +53,7 @@ class Queries::Projects::Filters::CustomFieldFilter < def self.custom_fields(_context) custom_field_class - .all + .visible end private diff --git a/spec/models/queries/projects/filters/custom_field_filter_spec.rb b/spec/models/queries/projects/filters/custom_field_filter_spec.rb index b6a4169bcd..da5919d8c6 100644 --- a/spec/models/queries/projects/filters/custom_field_filter_spec.rb +++ b/spec/models/queries/projects/filters/custom_field_filter_spec.rb @@ -80,7 +80,7 @@ describe Queries::Projects::Filters::CustomFieldFilter, type: :model do before do allow(ProjectCustomField) - .to receive_message_chain(:all, :exists?) + .to receive_message_chain(:visible, :exists?) .and_return(true) end @@ -301,7 +301,7 @@ describe Queries::Projects::Filters::CustomFieldFilter, type: :model do describe '.all_for' do before do allow(ProjectCustomField) - .to receive_message_chain(:all) + .to receive(:visible) .and_return([list_project_custom_field, bool_project_custom_field, int_project_custom_field,