In Rails AR, you can run queries as follows:
current_user.articles # fetch all articles from current_user SELECT * from articles where user_id = <user_id>;
Is there an equivalent way to do this with Ecto?
articles = Repo.all(from a in assoc(current_user, :articles))
or preload articles in the user
current_user = Repo.preload(current_user, [:articles]) current_user.articles
Source: https://habr.com/ru/post/1612848/More articles:Is it impossible to create immutable object graphs in some scenarios? - immutabilityБезшовная карта HList после foldRight - scalaSeamless tuple deconstruction in type parameter declaration - scalaSonarLint для Eclipse: настройте собственный профиль SonarQube & language? - eclipseAsynchronous cmd or readline in Python - pythonHow do you use the browser in the gulp task? - javascriptComputing between groups in a Pandas multiindex data frame - pythonUnPivot a Pandas Набор данных с объединением - pythonReverse grep regex matches all lines - bashHow to create MKCircle in Swift? - swiftAll Articles