searchable: fix searching by json attribute.

Fix accidentally hardcoding the attribute name to `metadata`.
This commit is contained in:
evazion
2022-09-29 02:22:42 -05:00
parent b625f95981
commit 09eb763e3c

View File

@@ -496,11 +496,11 @@ module Searchable
relation = self.relation
if params[name].present?
relation = visible(relation, name).where_json_contains(:metadata, params[name])
relation = visible(relation, name).where_json_contains(name, params[name])
end
if params["#{name}_has_key"]
relation = visible(relation, name).where_json_has_key(:metadata, params["#{name}_has_key"])
relation = visible(relation, name).where_json_has_key(name, params["#{name}_has_key"])
end
if params["has_#{name}"].to_s.truthy?