ActiveRecord can't do it? Arel can!
summary
Rails uses Arel under the hood to build SQL and the talk shows concrete swaps: a production Backpackers app with 31 users moves raw Postgres SQL into Arel expressions using Location.arel_table and attribute predicates like matches, does_not_match and GT. It composes complex queries—aliased self joins for “nearby locations within 5 km,” multi-join conditions, join_sources to feed ActiveRecord, and set operations like intersect/union/except—plus wrapping DB functions via Arel name functions so Postgres encryption and ordering live in portable AST nodes.
AI-written summary · about
chapters (35)
- 0:00Introduction
- 0:36Dippin
- 1:36Location
- 2:00Meetups
- 2:37Ruby India
- 3:16C42 Interview
- 5:41Traveler Class
- 6:37User count
- 7:09Performance
- 7:22ActiveRecord
- 7:40Query
- 8:14Search
- 8:24Problems
- 8:54What is Arel
- 9:32Arel vs ActiveRecord
- 10:08How Arel works
- 10:22How do I use it
- 10:41Getting started
- 10:52Write convenient method
- 11:09Refactor query using error
- 12:00Arel syntax tree
- 13:56Array arguments
- 14:23Arel hardcore
- 15:11Arel joints
- 15:21Arel waves
- 16:42Arel join conditions
- 17:54Arel focus
- 19:35Nearby locations
- 19:55Alias
- 20:56Joints
- 21:34Encryption
- 22:31Name Functions
- 23:13Order
- 23:41Summary
- 24:27Conclusion
related talks
21mActiveRecord can't do it? Arel can!
32mArel: The Ruby Relational Algebra Library
35mAdvanced aRel: When ActiveRecord Just Isn't Enough
28mActive Record Scopes and Arel
05mHow to use Arel? Wrong answers only!
17mWrangle Your SQL With Arel
30mBuilding an ORM with AReL: Walking up the (AS)Tree.
38mSequel: When ActiveRecord is not enough
