Created
October 15, 2019 21:32
-
-
Save nietaki/c489d38bed039d5dc060a82321d4595c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# aliases and imports omitted | |
query = | |
from(c in Comment, | |
where: c.user_id == ^charlie_id, | |
preload: [:post] | |
) | |
comments_by_charlie = Repo.all(query) | |
refute Enum.any?(comments_by_charlie, fn c -> c.post == nil end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment