Last Updated: February 25, 2016
·
1.781K
· benben

Active::Record Logger to STDOUT with pry

Put this in your ~/.pryrc file and you're good to go:

Pry.config.hooks.add_hook(:before_session, :rails) do
  if defined?(Rails)
    ActiveRecord::Base.logger = Logger.new(STDOUT)
  end
end