Skip to content

Instantly share code, notes, and snippets.

@wttj-tech
Created September 12, 2022 14:27
Show Gist options
  • Save wttj-tech/77252ee4635b18e5b529883df55bca67 to your computer and use it in GitHub Desktop.
Save wttj-tech/77252ee4635b18e5b529883df55bca67 to your computer and use it in GitHub Desktop.
Repo.get(User, id)
|> EctoAnon.run(Repo, cascade: true)
{:ok,
%User{
email: "redacted",
firstname: "Emilie",
last_sign_in_at: ~U[2018-01-01 00:00:00Z],
lastname: "redacted",
favorite_quote: %Quote{
quote: "redacted",
author: "redacted"
},
followers: [
%User{
email: "redacted",
firstname: "Fred",
last_sign_in_at: ~U[2023-01-01 00:00:00Z],
lastname: "redacted",
favorite_quote: nil,
quotes: []
}
],
quotes: [
%Quote{
quote: "redacted",
author: "redacted"
},
%Quote{
quote: "redacted",
author: "redacted"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment