This Week in Rails

January 31, 2025

Minimal apps, reply_to address, rotate secrets, podman support

Hi, it’s Claudio Baccigalupo. Let’s explore this week’s changes in the Rails codebase.

Extend –minimal option
rails new --minimal allows to create a basic Rails app, but recent additions to Rails were still included. Moving forward, this option will also skip Brakeman, CI, Docker, Kamal, Rubocop, Solid trifecta, and Thruster.

Add reply_to_address to Mail::Message
When using Action Mailer you can now specify a reply_to: email address in addition to the to: recipient.

Load the routes in the console when calling app
Have you ever needed to see what route helpers are available inside an IRB session? Moving forward they will be loaded in the app IRB helper.
$ bin/rails c
$ > app.root_path # => "/"


Fix rotate(on_rotation:)
MessageVerifier and MessageEncryptor were intended to accept an on_rotation callback but that wasn’t the case. This PR fixes the behavior.

Accept on_rotation argument in find_signed
Building on the previous change, find_signed and find_signed! now accept an on_rotation callback. This callback is triggered whenever the signed_id_verifier uses rotated secret keys, making it valuable for monitoring and tracking purposes.

Make the devcontainer script work with podman
podman is an alternative to Docker. If you have it installed, the devcontainer script will use it, otherwise it will fall back to Docker.

Fix Active Record instrumentation to be thread safe
When using Active Record async feature, the instrumentation was not thread safe. With the right race condition, instrumentation subscriptions would never fire up.

Fix inverting rename_enum_value options
Did you know that you can rename an enum in your migrations using rename_enum_value? This commit fixes a bug so the :from and :to options are parsed correctly.

Fix routes being cleared when using reload_routes!
Calling Rails.application.reload_routes! will now load all the routes without resetting them if they were already loaded.

You can view the whole list of changes here. We had 23 contributors to the Rails codebase this past week!

Until next time!

About This Week in Rails

Your weekly inside scoop of interesting commits, pull requests and more from Rails.