Trash.Test.Repo.restore-exclamation-mark

You're seeing just the function restore-exclamation-mark, go back to Trash.Test.Repo module for more information.
Link to this function

restore!(changeset)

Specs

restore!(changeset_or_schema :: Ecto.Changeset.t() | Ecto.Schema.t()) ::
  Ecto.Schema.t()

Updates a record as kept.

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 nil. It calls repo.update/2 to finalize the changes.

Raises Ecto.InvalidChangesetError if the changeset is invalid.

Note: since an Ecto.Schema struct can be passed which generates a bare changeset, this will never raise when given a struct.

Examples

iex> Post.changeset(post, %{title: "[Archived] Hello, world"})
     |> MyRepo.restore!()
%Post{title: "[Archived] Hello, world", discarded_at: nil}

iex> Post.changeset(post, %{}) |> MyRepo.restore!()
** (Ecto.InvalidChangesetError)