Does anybody know any plugin, that can show line numbers for SQL queries in Rails logs? Something like this:
User Load (0.003154) SELECT * FROM `users` WHERE (`users`.`id` = 1) - (user.rb, line 24)
Thanks!
This plugin puts the stack trace in your logs. As Daniel mentions it would be tricky to determine the line you wanted but I suspect you could work something out, and the trace itself may be good enough.
https://github.com/ruckus/active-record-query-trace
Be careful to set it up so you can turn it on and off. I used this for awhile, and while useful for tracking down specific bugs, it drove me nuts if it was on all the time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With