fix code to use ruby instead of databse calls