Best Practices for Ecto Associations

When working with models with associations, it is best to use related models: use Repo.preload explicitly or specify associations that should be preloaded when defining a request?

+4
source share
1 answer

They are equivalent, so any approach is fine. Make this part of the request if you want to have everything in one place. Repo.preload/2Useful when, for any reason, the request has already been completed.

+5
source

All Articles