Executing raw SQL in Rails.

Sometimes, when the moon is full, the tides are crashing, and you’re a fucking weirdo, you want to execute raw SQL in Rails. Here’s one way to do it:

ActiveRecord::Base.connection.execute(’SELECT * FROM users’)
<Mysql::Result:0×32d0994>

I don’t know anything about the MySQL object returned, but that’s how you do it. Have fun.
Update!
Hehe… Since your models extend ActiveRecord::Base, you could [...]