RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: named_scope xRefactoring x
Hacking with Arel
Episode #355May 30, 201270 comments

Hacking with Arel

Here I show a variety of ways to rewrite a long SQL query using only Active Record and Arel. This includes generating scopes dynamically, adding an "or" operator, and adding a powerful "match" method. (15 minutes)
Refactoring & Dynamic Delegator
Episode #212May 03, 201050 comments

Refactoring & Dynamic Delegator

Learn how to refactor a set of conditional Active Record queries using a Dynamic Delegator. (7 minutes)