[286.5] Firestorm Pairing Session 5 - Josh Adams and Andrew Vy Working with Ecto Polymorphism

Working through polymorphism in Ecto for Views and Follows (and eventually tags)

Subscribe now

Firestorm Pairing Session 5 - Josh Adams and Andrew Vy Working with Ecto Polymorphism [03.13.2017]

I paired this evening with Andrew Vy. I had already added a polymorphic View schema to the Firestorm Forum data model, and we were completing the work to use it appropriately in the UI. I hadn't actually done anything polymorphic in Ecto before today, which strikes me as surprising. There's a lot of frustration as we spent a good chunk of time not appreciating where an error was, and I start out by showing him something that strikes me as a bug in Ecto, though I'm not sure how best to pare it down to a small reproducible example. If you find that it's expected behaviour, I'm glad to learn why :)

I also introduced a gnarly n+1 query right in a view, and we wrote this little bit of ecto query that strikes me as fun. It determines whether a given thread is read or unread by a user.