diff --git a/app/models/queries/work_packages.rb b/app/models/queries/work_packages.rb index f898517300..8331b80b72 100644 --- a/app/models/queries/work_packages.rb +++ b/app/models/queries/work_packages.rb @@ -34,10 +34,8 @@ module Queries::WorkPackages register.filter Query, filters_module::AssignedToFilter register.filter Query, filters_module::AssigneeOrGroupFilter - if EnterpriseToken.allows_to?(:attachment_filters) - register.filter Query, filters_module::AttachmentContentFilter - register.filter Query, filters_module::AttachmentFileNameFilter - end + register.filter Query, filters_module::AttachmentContentFilter + register.filter Query, filters_module::AttachmentFileNameFilter register.filter Query, filters_module::AuthorFilter register.filter Query, filters_module::CategoryFilter register.filter Query, filters_module::CreatedAtFilter diff --git a/app/models/queries/work_packages/filter/attachment_base_filter.rb b/app/models/queries/work_packages/filter/attachment_base_filter.rb index 7ee0bddb20..f5d78e21e2 100644 --- a/app/models/queries/work_packages/filter/attachment_base_filter.rb +++ b/app/models/queries/work_packages/filter/attachment_base_filter.rb @@ -36,6 +36,11 @@ class Queries::WorkPackages::Filter::AttachmentBaseFilter < Queries::WorkPackage :attachments end + def available? + EnterpriseToken.allows_to?(:attachment_filters) + end + + def search_column raise NotImplementedError end