Ecto.Changeset.apply_action

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

apply_action(changeset, action)

View Source

Specs

apply_action(t(), atom()) :: {:ok, Ecto.Schema.t() | data()} | {:error, t()}

Applies the changeset action only if the changes are valid.

If the changes are valid, all changes are applied to the changeset data. If the changes are invalid, no changes are applied, and an error tuple is returned with the changeset containing the action that was attempted to be applied.

The action may be any atom.

Examples

iex> {:ok, data} = apply_action(changeset, :update)

iex> {:error, changeset} = apply_action(changeset, :update)
%Ecto.Changeset{action: :update}