Convert Changeset to Schema With Ecto
You can convert an Ecto.Changeset back to a schema by using Ecto.Changeset.apply_changes/1
movie_changeset = change(%Movie{title: "Citizen Kane"}, %{director: "Orson Welles"})
#=> This returns an ecto changeset with the new director change
apply_changes(movie_changeset)
#=> %Movie{title: "Citizen Kane", director: "Orson Welles"}
Tweet