Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
cspeper committed Jun 30, 2022
1 parent 72df8b5 commit 6ec680a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/dataloader/ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -893,9 +893,7 @@ if Code.ensure_loaded?(Ecto) do
build_preload_lateral_query(rest, join_query, :join_last)
end

defp maybe_distinct(%Ecto.Query{distinct: dist} = query, _) when dist do
query
end
defp maybe_distinct(%Ecto.Query{distinct: dist} = query, _) when dist, do: query

defp maybe_distinct(query, [%Ecto.Association.Has{}, %Ecto.Association.BelongsTo{} | _]),
do: distinct(query, true)
Expand Down
4 changes: 3 additions & 1 deletion test/dataloader/ecto_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ defmodule Dataloader.EctoTest do
ordered_usernames = Enum.map(loaded_posts, & &1.username)

assert ordered_usernames == expected_usernames,
"got #{inspect(ordered_usernames)} but was expecting #{inspect(expected_usernames)} for sort_order #{sort_order}"
"got #{inspect(ordered_usernames)} but was expecting #{inspect(expected_usernames)} for sort_order #{
sort_order
}"
end
end

Expand Down

0 comments on commit 6ec680a

Please sign in to comment.