You are looking for construct_finder_sql .
>> User.send (: construct_finder_sql, {: conditions => {: username => 'joe'}})
=> "SELECT * FROM \" users \ "WHERE (\" users \ ". \" Username \ "= E'joe ')"
>> User.scoped (: joins =>: orders,: conditions => {: username => 'joe'}). Send (: construct_finder_sql, {})
=> "SELECT \" users \ ". * FROM \" users \ "INNER JOIN \" orders \ "ON orders.user_id = users.id WHERE (\" users \ ". \" Username \ "= E'joe ' ) "
source share