Skip to content

Commit

Permalink
fix: use positional loading on embedded resources
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed May 8, 2024
1 parent 3ac4bc9 commit fad02ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ash/actions/read/read.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ defmodule Ash.Actions.Read do
pkey = Ash.Resource.Info.primary_key(original_query.resource)
# we have to assume they are all there and in the same order. Not my
# favorite thing, but no way around it in the short term.
if Enum.empty?(pkey) || missing_pkeys? do
if Ash.Resource.Info.embedded?(original_query.resource) || Enum.empty?(pkey) || missing_pkeys? do
Enum.zip_with([data, data_with_selected], fn [record, match] ->
record
|> Map.merge(Map.take(match, fields_from_data))
Expand Down

0 comments on commit fad02ce

Please sign in to comment.