@ -27,5 +27,26 @@
#++
class Query :: WorkPackages :: Filter < Query :: Filter
@@filter_types_by_field = superclass . filter_types_by_field . merge (
status_id : :list_status ,
type_id : :list ,
priority_id : :list ,
subject : :text ,
start_date : :date ,
due_date : :date ,
estimated_hours : :integer ,
done_ratio : :integer ,
project_id : :list ,
category_id : :list_optional ,
fixed_version_id : :list_optional ,
subproject_id : :list_subprojects ,
assigned_to_id : :list_optional ,
author_id : :list ,
member_of_group : :list_optional ,
assigned_to_role : :list_optional ,
responsible_id : :list_optional ,
watcher_id : :list
)
validates :field , inclusion : { in : @@filter_types_by_field . keys , message : " %(value) is not a valid filter " } , unless : Proc . new { | filter | filter . field . to_s . starts_with? ( 'cf_' ) }
end