rails/rails — pull request #10474 by crodjer (2013-05-05 14:39:38+00:00)
Title: Quote ActiveRecord::Relation with their SQL queries

This makes writing nested queries simpler, without any need for explicit
`to_sql` call. In some situations, where using `JOIN` becomes too
complicated, nested queries come in handy.