From 5472ccebefc5e29388666f9f562952b6e6f17937 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Tue, 19 Nov 2024 15:54:55 -0800 Subject: [PATCH] Add `is:modeled` query to items --- app/models/item/search/query.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/models/item/search/query.rb b/app/models/item/search/query.rb index e34c8c9c..aaad0f77 100644 --- a/app/models/item/search/query.rb +++ b/app/models/item/search/query.rb @@ -132,6 +132,8 @@ class Item is_positive ? Filter.is_np : Filter.is_not_np when 'pb' is_positive ? Filter.is_pb : Filter.is_not_pb + when 'modeled' + is_positive ? Filter.is_modeled : Filter.is_not_modeled else raise_search_error "not_found.label", label: "is:#{value}" end @@ -346,6 +348,14 @@ class Item self.new Item.is_not_pb, '-is:pb' end + def self.is_modeled + self.new Item.is_modeled, 'is:modeled' + end + + def self.is_not_modeled + self.new Item.is_not_modeled, '-is:modeled' + end + private # Add quotes around the value, if needed.