Skip to content

Instantly share code, notes, and snippets.

@subelsky
Last active May 3, 2017 17:31
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 subelsky/ad978389933b772e6d673e397d423c6e to your computer and use it in GitHub Desktop.
Save subelsky/ad978389933b772e6d673e397d423c6e to your computer and use it in GitHub Desktop.
How to make activerecord log SQL to the console
# makes Rails logs appear in the console, useful for seeing the actual SQL query generated from an AR find for example
# put this in ~/.railsrc
require 'logger'
Rails.logger = Logger.new STDOUT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment