Skip to content

Commit d1161fa

Browse files
author
Leo B
committed
Fix Ecto.assoc
1 parent 8f99d81 commit d1161fa

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/ecto.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,7 @@ defmodule Ecto do
527527
|> Enum.filter(&assert_struct!(schema, &1))
528528
|> Enum.map(fn struct ->
529529
case owner_key do
530+
single_key when is_atom(single_key) -> Map.fetch!(struct, single_key)
530531
[single_key] -> Map.fetch!(struct, single_key)
531532
[_ | _] -> owner_key |> Enum.map(&Map.fetch!(struct, &1)) # |> List.to_tuple()
532533
end

0 commit comments

Comments
 (0)