Safe Ecto Migrations by Fly.io Webinar, Elixir/Phoenix Security: Preventing SQL Injection in Ecto

Updating nested structs with put_in/2

Updating nested data in Elixir can be tough, since all data is immutable.

There’s a nice helper put_in/3 that works with maps. But unless structs implement the Access behaviour, we cannot use it with structs.

Turns out, there’s a put_in/2 macro that works with structs out of the box!

👀 https://youtu.be/F6XVhk0uTaY