Debugging ActiveRecord queries in a Rails console

19 Jan 2012 on
ruby

I'm going to share a command that comes in very handy when debugging ActiveRecord queries.
With it you can see the SQL queries generated by any method.
It's very useful when debugging your application in a console.