Oops, I broke user filters in my previous refactor!

Right, `user` is an important argument that I missed! 😅
This commit is contained in:
Emi Matchu 2024-02-27 15:08:15 -08:00
parent 76d741091c
commit cd786ffcb1

View file

@ -27,7 +27,7 @@ class Item
value = quoted_value || unquoted_value value = quoted_value || unquoted_value
is_positive = (sign != '-') 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? filters << filter if filter.present?
end end
@ -42,7 +42,7 @@ class Item
value = filter_params[:value] value = filter_params[:value]
is_positive = filter_params[:is_positive] != 'false' 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? filters << filter if filter.present?
end end
@ -51,7 +51,7 @@ class Item
private private
def self.parse_text_filter(key, value, is_positive) def self.parse_text_filter(key, value, is_positive, user)
case key case key
when 'name' when 'name'
is_positive ? is_positive ?
@ -111,7 +111,7 @@ class Item
end end
end end
def self.parse_params_filter(key, value, is_positive) def self.parse_params_filter(key, value, is_positive, user)
case key case key
when 'name' when 'name'
is_positive ? is_positive ?