惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
The Cloudflare Blog
量子位
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
MyScale Blog
MyScale Blog
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
D
DataBreaches.Net
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
U
Unit 42
博客园 - 聂微东
有赞技术团队
有赞技术团队
A
About on SuperTechFans

Ruby on Rails: Compress the complexity of modern web apps

Safer to_i coercion, custom to_fs formats, and more! This Week in Rails: May 16, 2026 This Week in Rails: May 8, 2026 This Week in Rails: May 1, 2026 Active Record gets better every week Great big Rails World 2026 update: CFP, Corporate Support tickets, workshops Query command for database queries and more Explicit query: and body: kwargs for integration tests and more! Speedup ActiveRecord::LogSubscriber#sql_color and more! This Week in Rails: March 27, 2026 Rails Versions 8.0.5 and 8.1.3 have been released! Rails Versions 7.2.3.1, 8.0.4.1, and 8.1.2.1 have been released! This Week in Rails: March 20, 2026 Validate URI scheme in Action Text and more This Week in Rails: March 6, 2026 Planning Center is the newest Rails Foundation Contributing member Action Text gets Markdown conversion, editor links in devcontainers, and more! BARRA seeks Rails developer Joe Agliozzo is looking for a Rails developer The rise of lighttpd as the alternative web server When longer is better and more is more Snowdevil: First e-tailer on Rails Natural selection for frameworks in Ruby vs Java Address book tutorial in Portuguese Becoming a better programmer with Rails 10 Things Every Java Programmer Should Know About Ruby Really Getting Started in Rails Off the Treadmill, Onto the Rails Rails 0.9.5: A world of fixes and tweaks Rich clients with Rails and XUL
must-understand, with_default_isolation_level, Rails Worl...
David Heinemeier Hansson · 2025-04-04 · via Ruby on Rails: Compress the complexity of modern web apps

Friday, April 4, 2025
Posted by vipulnsward

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

Last Week for Rails World 2025 Call for Papers
This is the last week for The CFP for Rails World 2025!

Submit your talk until April 10th.

Add must-understand directive according to RFC 9111
The must-understand directive indicates that a cache must understand the semantics of the response status code, or discard the response. This directive is enforced to be used only with no-store to ensure proper cache behavior.

class ArticlesController < ApplicationController
  def show
    @article = Article.find(params[:id])
    if @article.special_format?
      must_understand
      render status: 203 # Non-Authoritative Information
    else
      fresh_when @article
    end
  end
end

Use UNLINK for RedisCacheStore in ActiveSupport
The RedisCacheStore now uses Redis’s UNLINK command instead of DEL for cache entry deletion, enabling asynchronous and non-blocking removal of keys, which enhances performance.

Add Cache#read_counter and Cache#write_counter
This introduces 2 new methods on Rails.cache: read_counter and write_counter, to read values that are being incremented/decremented.

Rails.cache.write_counter("foo", 1)
Rails.cache.read_counter("foo") # => 1
Rails.cache.increment("foo")
Rails.cache.read_counter("foo") # => 2

Change redirect status code in SessionsController#destroy template from 302 to 303
The new Authentication generator introduced in Rails 8.0, creates a SessionsController that returns a 302 Redirect response in its destroy action. With this change it will now issue a 303(See Other) status code instead of 302(Found) when redirecting after logout, to comply with the 9110 spec

Include cookie name in length calculation
This change updates Rails to include the cookie name’s length when validating that a cookie stays within the 4KB limit, aligning its behavior with browser standards.

Introduce with_default_isolation_level in ActiveRecord
This change introduces the with_default_isolation_level method in ActiveRecord, allowing to set a default database isolation level for specific code blocks. This is particularly useful when migrating large applications to a new isolation level, as it enables enforcing the desired level in targeted areas, such as base controllers, facilitating smoother transitions and ensuring consistent transaction behavior.

class ApiV2Controller < ApplicationController
  around_action :set_isolation_level

  def set_isolation_level
    Product.with_default_isolation_level(:read_committed) do
      yield
    end
  end
end
# forces all controllers that subclass from ApiV2Controller to start getting new isolation level

With postgres adapter, prepend structure_load_flags instead of appending them When using postgres adapter and the structure_load_flags options, the extra flags were appended instead of prepended to the default ones, causing the psql command to ignore some of the extra flags. Now, the default arguments args are appended to the extra_flags instead of the opposite.

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

Until next time!

Subscribe to get these updates mailed to you.