Buy @ Amazon

Search This Blog

October 21, 2011

SQL Logging in Rails Console IRB


In order to quickly find the SQL queries that are fired against the DB, while you are playing on the Rails Console, all you need to do is set ActiveRecord's Logger to STDOUT as below:

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