Ecto.Changeset.apply_action-exclamation-mark

You're seeing just the function apply_action-exclamation-mark, go back to Ecto.Changeset module for more information.
Link to this function

apply_action!(changeset, action)

View Source

Specs

apply_action!(t(), atom()) :: Ecto.Schema.t() | data()

Applies the changeset action if the changes are valid or raises an error.

Examples

iex> changeset = change(%Post{author: "bar"}, %{title: "foo"})
iex> apply_action!(changeset, :update)
%Post{author: "bar", title: "foo"}

iex> changeset = change(%Post{author: "bar"}, %{title: :bad})
iex> apply_action!(changeset, :update)
** (Ecto.InvalidChangesetError) could not perform update because changeset is invalid.

See apply_action/2 for more information.