Created
January 24, 2023 09:08
-
-
Save dtbaker/f5893ffcbb5833b0564515c8ded152ea to your computer and use it in GitHub Desktop.
Debug SQL queries in rails app
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
module YourApp | |
class Application < Rails::Application | |
# all the things.... | |
# Print SQL debug to the console | |
config.after_initialize do | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Base.verbose_query_logs = true | |
Rails.logger.level = Logger::DEBUG | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment