Quantcast
Viewing latest article 1
Browse Latest Browse All 4

Answer by Cody Caughlan for How to show SQL statements in Rails console like WEBrick?

A similar way to achieve this without resorting to digging into ActiveRecord internals and using instance variables is to just access the config object that Rails gives you. Place this inside config/application.rb:

config.logger = Logger.new(STDOUT) if($0 == 'irb' || $0 == 'script/rails')

Viewing latest article 1
Browse Latest Browse All 4

Trending Articles