Output Logger and SQL to the Rails Console in Development Mode

       

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 w/ #active record #console #development #logging #stdoutruby on rails

Apps I've Built

PhotoLocationChanger
Easily change the location on your photos and videos
Click here for more info about the app
PhotoDateChanger
Easily change the dates and times on your photos and videos
Click here for more info about the app
VocabReminder
English dictionary with notifications so you won't forget what you're studying!
Click here for more info about the app
VocabQuiz
The app that quizzes and scores you on your vocabulary!
Click here for more info about the app