Trash.Test.Repo.restore
You're seeing just the function
restore
, 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()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.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.
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: "Hello, world"})
|> MyRepo.restore()
{:ok, %Post{title: "Hello, world", discarded_at: nil}}