Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ecto, preloadでソート
child_query = from c in Child, order_by: c.code
query = from p in Parent,
where == ^id,
preload: [child: ^child_query]
case Repo.all(query) do
nil -> {:not_found}
record -> {:ok, record}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.