Written by Sean Behan on Sun Jun 17th 2012

If you want to take a look at the SQL being generated by active record while your using the console, you can either type this into the console when it loads

ActiveRecord::Base.logger = Logger.new(STDOUT)
Or you can add it to your environment so that it'll be the default behavior rails_root/config/environments/development.rb
#...
ActiveRecord::Base.logger = Logger.new(STDOUT)
It's a nice way to keep you away of any expensive queries you may unknowingly be writing!

Tagged with..
#active record #console #development #logging #stdout #Ruby on Rails

Just finishing up brewing up some fresh ground comments...