I’m following the book Mastering Phoenix Framework from Phoenix inside-out series. At page #158, whenever I run this test (highlighted in the screenshot),
I tried my best and repeated from the start of the chapter several times, but every time it’s giving me the same problem.
Did anyone else face this problem while following this book? If yes, how did you solve it?
Thank you @voger for your reply, and for being so much helpful at this forum!
I asked Shankar (the author of the book) through his email a while ago and he replied within minutes. He said the reason might be multiple migration files (may be because of going back and forth to different git branches). He told me similar solution and it worked for me
Thank You @shankardevy for writing this fantastic book series and for being a humble and great human being!
I also have a question from this book, which is kind of an Elixir language question, so I thought I’ll add my question here instead of cluttering the book’s page.
Will somebody please explain the with part in this code?
When I was learning basics of Elixir, I wasn’t able to learn the with, and once again this with is in front of me, and I’m not able to get it.
else_fn = fn
{:error, reason} -> Logger.error(reason)
err -> Logger.error("Unknown error: #{inspect error}")
else -> else
end
case something() do
{:ok, a} ->
case something_else() do
:blah -> a
else -> err_fn.(else))
end
else -> err_fn.(else))
end