Support multiple exclusions

Since it does a not of numeric_attribute_matches which uses the
post query builder, it now also support reverse ranges and reverse
greater/less than.
This commit is contained in:
BrokenEagle
2021-01-06 19:22:21 +00:00
parent 65be2c99b0
commit 4a439d72d6

View File

@@ -206,6 +206,8 @@ module Searchable
def search_numeric_attribute(attr, params)
if params[attr].present?
numeric_attribute_matches(attr, params[attr])
elsif params[:"#{attr}_not"].present?
where.not(id: numeric_attribute_matches(attr, params[:"#{attr}_not"]))
elsif params[:"#{attr}_eq"].present?
where_operator(attr, :eq, params[:"#{attr}_eq"])
elsif params[:"#{attr}_not_eq"].present?