Working @GitHub Support, programming for fun, working remotely, love cooking and food, and want to learn how to play the guitar.
Published on 2010-07-07
There are times when we want to see the SQL ActiveRecord generates. We can do it easily by issuing the following statement as soon as we run script/console:
ActiveRecord::Base.logger = Logger.new(STDOUT)
Now each time we issue an ActiveRecord statement, we'll get the SQL first.