Today I Learned

hashrocket A Hashrocket project

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"
See More #elixir TILs
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.