Friday, April 24, 2026

Active Record gets better every week

Posted by claudiob

Hi, it’s Claudio Baccigalupo. Let’s explore what happened this week in Ruby on Rails.

Apply as a speaker for Rails World
Don’t miss out on the opportunity to join 1,200+ Rails developers this year at the Palmer Center, Austin, TX. Corporate Support tickets are on sale now. General admission tickets will be released on May 12.

How do you use Ruby on Rails?
The 2026 Ruby on Rails Community Survey is open! Takes just a few minutes. Please fill out and share with your team!

Bump required PostgreSQL version to 10.0
Until now Rails claimed support for PostgreSQL 9.3, which is incompatible with PostgreSQL 18 (released in 2025). The pg gem v1.6 already raised its minimum required PostgreSQL. This change makes version 10 the minimum supported by Rails main.

Let add_column raise if :null is true for PKs
Primary keys get a NOT NULL constraint unconditionally. In particular, null: true was being ignored, thus not doing what the user specified. Now it will raise an error to let the user know the call is invalid.

Optimize merging ActiveRecord::Relation extensions
Now calling extending on an Active Record relation can be twice as fast.

Fix nested with_connection incorrectly clearing sticky lease set by lease_connection
When lease_connection is called to permanently lease a connection within a with_connection block, a subsequent nested with_connection(prevent_permanent_checkout: true) would incorrectly clear the sticky flag. This caused the outer with_connection block to release the connection on exit, even though it had been explicitly leased.

Fix TTOU hanging Rails when ffmpeg is spawned for video previews
When generating video previews in ActiveStorage, Rails launches ffmpeg as a subprocess, which watches for keypresses (e.g. q to quit). If Rails is run with its own process group (e.g. using overman), this causes the Rails process to receive a TTOU signal, which resulted in Rails hanging indefinitely.

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

Until next time!

Subscribe to get these updates mailed to you.