Best Rails One Liner for Debugging
Please note that all opinions are that of the author.
Last Updated On: 2025-11-26 06:51:47 -0500
How many times have all of us left this in our code bases:
debugger
Here’s my new favorite convention:
debugger unless Rails.env.production?
That will work in development or test mode but will not execute in production. Perfection. And a great example of “unless” which I normally have problems using.