Talking head
RailsConf 2012

This presentation, by Jacob Swanner, is licensed under a Creative Commons Attribution ShareAlike 3.0

Scopes are a great way of encapsulating query logic in a granular, reusable way. This talk will cover some techniques you can use to keep those scopes as composable and portable as possible. We’ll cover how to use Arel directly, while avoiding the common practice of using SQL fragments, and show you how this can make your scopes more reusable, while at the same time preventing you from using database vendor specific operators, such as ILIKE.

Rated: Everyone
Viewed 2,251 times
Tags: arel