Skip to content

Commit 87e2d5e

Browse files
authored
Merge pull request #325 from anhnk/bug/search-field-association
Fix bug related to search field across association
2 parents c89f9cd + 9096c41 commit 87e2d5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/kaffy/resource_query.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ defmodule Kaffy.ResourceQuery do
163163
term_type == :string do
164164
term = "%#{term}%"
165165

166-
from(r in current_query,
166+
from([..., r] in current_query,
167167
or_where: ilike(type(field(r, ^f), :string), ^term)
168168
)
169169
else
170170
if Kaffy.ResourceSchema.field_type(schema, f) in [:id, :integer] and
171171
term_type == :decimal do
172172
current_query
173173
else
174-
from(r in current_query,
174+
from([..., r] in current_query,
175175
or_where: field(r, ^f) == ^term
176176
)
177177
end

0 commit comments

Comments
 (0)