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.

Here it is:

ActiveRecord::Base.logger = Logger.new(STDOUT)

Hrvoje Šimić

@shime_sh I'm a Ruby developer focused on building MVPs with Ruby on Rails.