From 9096c41a0f876851cb4cbcd78e8f0ce751db09fc Mon Sep 17 00:00:00 2001 From: Anh Do Date: Sun, 15 Dec 2024 20:58:29 +1100 Subject: [PATCH] Fix bug related to search field across association --- lib/kaffy/resource_query.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kaffy/resource_query.ex b/lib/kaffy/resource_query.ex index c88d91ab..2c80ee57 100644 --- a/lib/kaffy/resource_query.ex +++ b/lib/kaffy/resource_query.ex @@ -163,7 +163,7 @@ defmodule Kaffy.ResourceQuery do term_type == :string do term = "%#{term}%" - from(r in current_query, + from([..., r] in current_query, or_where: ilike(type(field(r, ^f), :string), ^term) ) else @@ -171,7 +171,7 @@ defmodule Kaffy.ResourceQuery do term_type == :decimal do current_query else - from(r in current_query, + from([..., r] in current_query, or_where: field(r, ^f) == ^term ) end