Quiz: Make Multiple Changes

Quiz yourself on making multiple changes.

We'll cover the following...
Technical Quiz
1.

What is wrong with the following code snippet?

artist = %Artist{name: "Ben Webster"}
Repo.transaction(fn ->
Repo.insert!(artist) 
Repo.insert(Log.changeset_for_insert(artist)) 
end)
A.

It’s not using the Ecto.Multi module.

B.

The transaction function won’t work with anonymous functions.

C.

The second insert should be insert!.

D.

The snippet has no errors.


1 / 5