Created
July 2, 2013 20:04
-
-
Save ephekt/5912631 to your computer and use it in GitHub Desktop.
Enable ActiveRecord to output raw queries in Rails Console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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