Trash.Repo.discard

You're seeing just the function discard, go back to Trash.Repo module for more information.
Link to this function

discard(changeset, repo)

Specs

discard(
  changeset_or_schema :: Ecto.Changeset.t() | Ecto.Schema.t(),
  repo :: atom()
) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Updates a record as discarded.

This takes either an Ecto.Changeset or an Ecto.Schema struct. If a struct is given a bare changeset is generated first.

A change is added to the changeset to set discarded_at to DateTime.utc_now/1. It calls repo.update/2 to finalize the changes.

It returns {:ok, struct} if the struct has been successfully updated or {:error, changeset} if there was an error.

Examples

iex> Post.changeset(post, %{title: "[Archived] Hello, world"})
     |> Trash.Repo.discard(MyApp.Repo)
{:ok, %Post{title: "[Archived] Hello, world", discarded_at: %DateTime{}}}