rails/rails — pull request #12508 by pftg (2013-10-12 11:44:52+00:00)
Title: Generate subquery for Relation passed as array condition for where

Instead of executing 2 queries for fetching records filtered by array condition with Relation,
added generation of subquery to current query.

This behaviour will be consistent when passes Relation as hash condition to where

Closes: #12415