Use ? variables in the resource queries.

Last of the followups from @jeffweiss review notes on the rails3 PR.