Friday, February 13, 2026

This Week in Rails: February 13, 2026

Posted by zzak

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

Add extension point to customize transaction for persistence methods
Extracts the implicit transaction creation in persistence methods into an overridable private method, giving models full control over transaction behavior for save and destroy operations.

Load hook guard
Adds a new guard_load_hooks method to Rails::Railtie that checks if the Rails app is loaded when a load hook is called, with options to log or raise on early loading.

Avoid combinatory explosion of filter parameters
Fixes a performance degradation where using Active Record encryption with many models caused filter_parameters to grow into thousands of entries, producing a massive regexp and making attribute filtering very slow.

ActiveSupport::ParameterFilter: optimize redundant patterns out
Active Record encryption automatically registers deep patterns for all encrypted attributes, which can grow large and impact performance. This performs dead code elimination during the precompilation step to remove redundant filters.

EventReporter: filter events before building the payload
Changes event filtering to only provide the event name, avoiding the cost of building the full payload for filtered events.

Fix Marshal deserialisation of Integer type from Rails 8.0
Fixes a regression where ActiveModel::Type::Integer objects serialised under Rails 8.0 raised NoMethodError when loaded under 8.1. The fix lazy-initialises @max and @min from the correctly restored limit attribute.

Don’t eagerly cache JSON Encoder in ActiveRecord::Type::Json
Caching the encoder when the class is first referenced prevented overriding it later. This now uses ActiveSupport::JSON’s cached encoder instead.

Fix ThroughReflection#association_primary_key with composite keys
Fixes a bug where composite primary_key arrays were converted to a string via .to_s instead of mapping each element, causing UnknownAttributeReference errors on _ids reader methods.

Deprecate Mail::Address.wrap
This deprecates Mail::Address.wrap for removal in 8.2.

Remove the deprecated Multibyte Chars class
Removes the deprecated ActiveSupport::Multibyte::Chars class and String#mb_chars method.

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

Until next time!

Subscribe to get these updates mailed to you.