Here's the gist of the step-wise refactoring done during the talk. Included below are some specific links that were insightful to me as I dug in to this.
- A RailsConf 2014 Presentation from the creator of Scuttle, a tool for automatically generating Arel from a SQL query
- The Definitive Guide to Arel—a blog post giving a great overview of Arel's functionality
- O'Reilly gives an intro to Arel and then a deeper dive
- Arel Helpers is a gem that provides some syntactic sugar for interacting with Arel.
- Some nice sample code showing how Arel can be used well.
- Nick Kallen, original author, explains the origins of Arel
- Arel being originally introduced on Rails Dispatch, where it is described as ActiveRelation
- Ernie Miller clearing up the difference in Arel and ActiveRecord::Relation
- Arel on Github
- Relational Algebra on Wikipedia
- A Relational Model of Data for Large Shared Data Banks
- Abstract Syntax Trees on Wikipedia
- Ruby ASTs by Ilya Grigorik
- The Visitor Pattern on Wikipedia
- Variations on the Visitor Pattern, where the extrinsic visitor is introduced
- Aaron Patterson on double dispatch in Ruby