Quantcast
Channel: How to show SQL statements in Rails console like WEBrick? - Stack Overflow
Browsing all 4 articles
Browse latest View live

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

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...

View Article



Answer by Srinivas M.V. for How to show SQL statements in Rails console like...

Go to your console.rb location /lib/rails/console.rbLook for ActiveRecord::Base.connection.instance_variable_setChange it to followingActiveRecord::Base.connection.instance_variable_set :@logger,...

View Article

Answer by sameera207 for How to show SQL statements in Rails console like...

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...

View Article

How to show SQL statements in Rails console like WEBrick?

Rails WEBrick shows raw SQL statements for any ActiveRecord activities. How to enable that in the console?

View Article
Browsing all 4 articles
Browse latest View live




Latest Images