Rails WEBrick shows raw SQL statements for any ActiveRecord activities. How to enable that in the console?
8
votes
3 Answers
12
votes
To do this you have to enable logger, you could do this as follows.
Open the rails console:
ActiveRecord::Base.connection.instance_variable_set :@logger, Logger.new(STDOUT)
Have a look at this link:
http://rubyquicktips.com/post/292826666/display-activerecord-generated-sql-queries-in-the
3
votes