Show SQL statements in log in Rails 2.3
Working in an old project and need to see the SQL statements in your logs? Run this as soon as you're in a console, before you run anything else:
ActiveRecord::Base.connection.instance_variable_set :@logger, Logger.new(STDOUT)
Written by Chad Ostrowski
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#