From c562600f0ba72387823d7da93bc633a668b66321 Mon Sep 17 00:00:00 2001 From: Tobias Pfeiffer Date: Wed, 16 Apr 2025 15:21:59 +0200 Subject: [PATCH] Clarify the interaction between `reload` and associations I was pretty sure what the behavior was, went ahead and tested it but thought it may be helpful to add it to the docs as it could also be reasonable to assume that all preloaded associations are reloaded as well. --- lib/ecto/repo.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ecto/repo.ex b/lib/ecto/repo.ex index dd22b107ab..d8d6e29907 100644 --- a/lib/ecto/repo.ex +++ b/lib/ecto/repo.ex @@ -968,6 +968,8 @@ defmodule Ecto.Repo do to the same schema. Ordering is guaranteed to be kept. Results not found in the database will be returned as `nil`. + Preloaded association will be discarded and need to be preloaded again. + ## Example MyRepo.reload(post)