Skip to content

Instantly share code, notes, and snippets.

@jhsu
Created August 9, 2010 15:51
Show Gist options
  • Save jhsu/515602 to your computer and use it in GitHub Desktop.
Save jhsu/515602 to your computer and use it in GitHub Desktop.
# source: https://wincent.com/wiki/Showing_SQL_statements_in_the_Rails_console
if ENV['RAILS_ENV']
# Called after the irb session is initialized and Rails has been loaded
IRB.conf[:IRB_RC] = Proc.new do
logger = Logger.new(STDOUT)
ActiveRecord::Base.logger = logger
ActiveResource::Base.logger = logger
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment