Friday, July 18, 2025

A new touch option, accessing the editor from the error page and better migration logs

Posted by claudiob

Hi, it’s Claudio Baccigalupo. So many great changes to the Rails codebase this week. Let’s check them out.

Add touch option to update_column(s)
Particularly useful for ETL processes that rely on the updated_at timestamps instead of copying the whole table. Previously, to keep timestamps current, the touch method had to be called after using update_column.

Add support to open files in the code editor from the crash page
All the most common editors are supported, from Atom to Zed.

Fix errors when query string keys have invalid encoding
Bots hitting your Rails app with malformed requests could generate noisy 500 Server Errors. After this PR the requests won’t be reported as an app exception.

Fix log message for down migrations
When reverting a migration, the message in the log will stop saying “Migrating to [version]” and will instead say “Reverting [version]”.

Raise an error in finder methods when the model has no ORDER columns
Adds a new ActiveRecord::MissingRequiredOrderError which gets raised in methods like last and find_nth when there are no order columns to use for the default order.

Return a 500 on MissingController errors
A controller not existing isn’t a routing error that should result in a 404, but a programming error that should result in a 500 and be reported.

Optimize Active Record batching further when using ranges
Improves the efficiency of the in_batches method by using OFFSET in the SQL query when the use_ranges: true option is provided.

Optimize ActiveSupport::SafeBuffer
Saves allocating unnecessary memory based on the assumption that the overwhelming majority of SafeBuffer instances are never mutated.

Ensure RequestForgeryProtection#normalize_action_path is private
The method added in 033acf8 was not intended to be public.

Add tsort as a runtime dependency to railties
tsort has been extracted from the Ruby standard library and is now included as a gem.

Propshaft upgraded to 1.2.0
See what has changed in the latest release of the library.

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

Until next time!

Subscribe to get these updates mailed to you.