Best Rails One Liner for Debugging
Please note that all opinions are that of the author.
Last Updated On: 2025-10-13 07:27:39 -0400
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.