fix: broken types for in operator

This commit is contained in:
Zach Daniel 2020-09-23 11:20:26 -04:00
parent a01a529355
commit 3304807dfc
No known key found for this signature in database
GPG key ID: C377365383138D4B

View file

@ -1139,7 +1139,7 @@ defmodule AshPostgres.DataLayer do
end
defp simple_operator_expr(op, params, value, type, current_binding, attribute, false) do
{params ++ [{value, Ash.Type.ecto_type(type)}],
{params ++ [{value, op_type(type)}],
{op, [],
[
{{:., [], [{:&, [], [current_binding]}, attribute]}, [], []},
@ -1156,6 +1156,14 @@ defmodule AshPostgres.DataLayer do
]}}
end
defp op_type({:in, type}) do
{:in, op_type(type)}
end
defp op_type(type) do
Ash.Type.ecto_type(type)
end
defp tagged(value, type) do
%Ecto.Query.Tagged{value: value, type: get_type(type)}
end