Skip to content

Instantly share code, notes, and snippets.

@ephekt
Created July 2, 2013 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ephekt/5912631 to your computer and use it in GitHub Desktop.
Save ephekt/5912631 to your computer and use it in GitHub Desktop.
Enable ActiveRecord to output raw queries in Rails Console
# In your active `rails c` session type
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.connection_pool.clear_reloadable_connections!
# or, in your ~/.irbrc add the following
require 'rubygems'
if ENV.include?('RAILS_ENV') && ENV["RAILS_ENV"] == 'development'
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.connection_pool.clear_reloadable_connections!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment