Created
July 5, 2011 13:24
-
-
Save stream7/1064825 to your computer and use it in GitHub Desktop.
SQL logs from activerecord 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
For Rails 2: | |
ActiveRecord::Base.connection.instance_variable_set :@logger, Logger.new(STDOUT) | |
For Rails 3: | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
taken form http://stackoverflow.com/questions/1344232/how-can-i-see-the-sql-that-will-be-generated-by-a-given-activerecord-query-in-rub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment