Skip to content

Instantly share code, notes, and snippets.

@kewinwang
Forked from bastien/irbrc.rb
Created April 10, 2011 09:59
Show Gist options
  • Save kewinwang/912202 to your computer and use it in GitHub Desktop.
Save kewinwang/912202 to your computer and use it in GitHub Desktop.
# To show SQL Statements in the rails console
# copy this code to ~/.irbrc
# code found there http://frozenplague.net/2008/12/showing-sql-statements-in-scriptconsole/
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment