Skip to content

Instantly share code, notes, and snippets.

@krainboltgreene
Created December 26, 2019 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krainboltgreene/3ec155f47fc669c655facc947ae2e8f5 to your computer and use it in GitHub Desktop.
Save krainboltgreene/3ec155f47fc669c655facc947ae2e8f5 to your computer and use it in GitHub Desktop.
post
|> Repo.preload(:tags)
|> Ecto.Changeset.change()
|> Ecto.Changeset.put_assoc(:tags, [tag | post.tags])
|> Repo.update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment