limit custom field filters by cf visibility

pull/5981/head
Jens Ulferts 7 years ago
parent 67e8d7cead
commit c61619b6ef
No known key found for this signature in database
GPG Key ID: 3CAA4B1182CF5308
  1. 2
      app/models/queries/projects/filters/custom_field_filter.rb
  2. 4
      spec/models/queries/projects/filters/custom_field_filter_spec.rb

@ -53,7 +53,7 @@ class Queries::Projects::Filters::CustomFieldFilter <
def self.custom_fields(_context)
custom_field_class
.all
.visible
end
private

@ -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,

Loading…
Cancel
Save