Best Rails One Liner for Debugging
Please note that all opinions are that of the author.
Last Updated On: 2026-02-15 08:01:34 -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.