add generic card quantitity query, using only arel