Skip to content

Instantly share code, notes, and snippets.

@bvsatyaram
Created December 20, 2011 05:27
Show Gist options
  • Save bvsatyaram/1500394 to your computer and use it in GitHub Desktop.
Save bvsatyaram/1500394 to your computer and use it in GitHub Desktop.
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