Skip to content

Commit 875d58c

Browse files
author
Thales César
committed
Add type cast to string
1 parent 117a4f6 commit 875d58c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/kaffy/resource_query.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ defmodule Kaffy.ResourceQuery do
118118
query = from(s in q, join: a in assoc(s, ^association))
119119

120120
Enum.reduce(fields, query, fn f, current_query ->
121-
from([..., r] in current_query, or_where: ilike(field(r, ^f), ^term))
121+
from([..., r] in current_query, or_where: ilike(type(field(r, ^f), :string), ^term))
122122
end)
123123

124124
f, q ->
125-
from(s in q, or_where: ilike(field(s, ^f), ^term))
125+
from(s in q, or_where: ilike(type(field(s, ^f), :string), ^term))
126126
end)
127127
end
128128

0 commit comments

Comments
 (0)