Use ActiveRecord to generate queries for specs