Execute SQL in Rails Console

By richardtylee

Thanks to The Coding Slim Jim for this snippet:

results = ActiveRecord::Base.connection.execute("select * from customers")
while row = results.fetch_row do
# process row here
end