queries under ruby