Title: Ash Framework: Incorrect return of {:ok, …} for bang (!) function (page 20)
In the section Defining a destroy action
:
iex(3)> artist = Tunez.Music.get_artist_by_id!("the-artist-id")
{:ok, #Tunez.Music.Artist<id: "an-artist-id", ...>}
should be similar to the entry provided in page 19:
iex(3)> artist = Tunez.Music.get_artist_by_id!("the-artist-id")
#Tunez.Music.Artist<id: "an-artist-id", ...>
since we are calling the bang variant (get_artist_by_id!
) instead of the normal variant (get_artist_by_id
).