From cd786ffcb15c2971c2111f4280fde479bb9e799b Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Tue, 27 Feb 2024 15:08:15 -0800 Subject: [PATCH] Oops, I broke user filters in my previous refactor! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Right, `user` is an important argument that I missed! 😅 --- app/models/item/search/query.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/item/search/query.rb b/app/models/item/search/query.rb index 59abfb28..a88ebf9f 100644 --- a/app/models/item/search/query.rb +++ b/app/models/item/search/query.rb @@ -27,7 +27,7 @@ class Item value = quoted_value || unquoted_value is_positive = (sign != '-') - filter = parse_text_filter(key, value, is_positive) + filter = parse_text_filter(key, value, is_positive, user) filters << filter if filter.present? end @@ -42,7 +42,7 @@ class Item value = filter_params[:value] is_positive = filter_params[:is_positive] != 'false' - filter = parse_params_filter(key, value, is_positive) + filter = parse_params_filter(key, value, is_positive, user) filters << filter if filter.present? end @@ -51,7 +51,7 @@ class Item private - def self.parse_text_filter(key, value, is_positive) + def self.parse_text_filter(key, value, is_positive, user) case key when 'name' is_positive ? @@ -111,7 +111,7 @@ class Item end end - def self.parse_params_filter(key, value, is_positive) + def self.parse_params_filter(key, value, is_positive, user) case key when 'name' is_positive ?