Skip to content

Instantly share code, notes, and snippets.

@bastien
Created July 8, 2009 14:21
Show Gist options
  • Save bastien/142874 to your computer and use it in GitHub Desktop.
Save bastien/142874 to your computer and use it in GitHub Desktop.
To show SQL Statements in the rails console
# 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