I have Category and it has many articles. I want to load a Category from a db and sort Articles in it based on “inserted_at” date of an Article.
ctg = Repo.get(Category, 123)
|> Repo.preload([article: :mmedia_entity])
# how? ????
# |> order_by(asc: :article.inserted_at)
How to do that?