Created
September 26, 2016 13:38
-
-
Save weiland/119826d4a7da5bd7d90f8549f0bd6a1d to your computer and use it in GitHub Desktop.
Soft Delete in Ecto
This file contains hidden or 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
model = Repo.get!(Model, id) | |
Ecto.Changeset.change(model) | |
|> Ecto.Model.Timestamps.put_timestamp(:deleted_at, Ecto.DateTime, true) | |
|> Repo.update | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment