Directly fetch a change from a phoenix changeset
If you want to pull the value of a specific change out of a changeset, you can use fetch_change/2
. Simply pass the function a changeset, and the name of the column where you want to see the change.
changeset = change(%User{}, %{first_name: "John"})
|> fetch_change(:first_name)
# => "John"
Tweet