ActiveRecord::Base.connection.select_all() returns integers as strings

When you do select_all Rails doesn’t do any typecasting (since it only does that when it has a correspond model object) so what you’ll get depends on your database driver. The mysql driver returned everything as strings for example but the mysql2 driver returns integers, dates etc as appropriate. I don’t know how things play out in postgres-land though.