Fixing SQL statement on Votes model to accommodate PG