Skip to content

Commit c686f91

Browse files
author
Leo B
committed
Fix post-compile assoc validation
1 parent b533d92 commit c686f91

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ecto/association.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,10 +727,13 @@ defmodule Ecto.Association do
727727
defp primary_key!(struct), do: Ecto.primary_key!(struct)
728728

729729
def missing_fields(queryable, related_key) do
730-
Enum.filter related_key, &is_nil(queryable.__schema__(:type, &1))
730+
related_key
731+
|> List.wrap()
732+
|> Enum.filter(&is_nil(queryable.__schema__(:type, &1)))
731733
end
732734

733735
def missing_primary_keys(queryable, related_key) do
736+
related_key = List.wrap related_key
734737
Enum.reject queryable.__schema__(:primary_key), &(&1 in related_key)
735738
end
736739

0 commit comments

Comments
 (0)