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

推荐订阅源

C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
V
Visual Studio Blog
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 聂微东
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
大猫的无限游戏
大猫的无限游戏
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
D
Docker
MyScale Blog
MyScale Blog
小众软件
小众软件
云风的 BLOG
云风的 BLOG
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 【当耐特】

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
RFC-9111 style Cache-Control directives hit or miss
David Heinemeier Hansson · 2025-05-16 · via Ruby on Rails: Compress the complexity of modern web apps

Friday, May 16, 2025
Posted by zzak

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

Message from the Rails Foundation
While Rails World sold out quickly this year, a friendly reminder that the sessions will be recorded and published on YouTube quickly- the Opening and Closing Keynotes immediately, with all other sessions published shortly thereafter.
If you didn’t manage to get a ticket, this is a fantastic opportunity to check out some of the other Ruby events taking place this year: https://rubyconferences.org/

Add ActiveRecord::Result#affected_rows
The result returned from calling exec_query now provides a method to get the number of affected rows.

# Get the number of rows affected by the query:
result = ActiveRecord::Base.lease_connection.exec_query <<~SQL.squish
  INSERT INTO posts (title, body)
  VALUES ("title_1", "body_1"), ("title_2", "body_2")
SQL
result.affected_rows
# => 2

Drop vendored Trix files in favor of the “action_text-trix” gem
This change shouldn’t have affect on applications, but makes maintenance easier for the Rails team. Meaning that bug fixes or security patches to Trix no longer have to wait for a Rails release to be available for application developers.

Bump Trix to v2.1.15
Speaking of which, CVE-2025-46812 was fixed in the latest release of Trix. Please update your applications as soon as possible.

Only load from CGI when required for Ruby 3.5
By retiring CGI from Ruby’s Standard Library of bundled gems, Rails was updated to load the cgi/escape which is still supported without emitting warnings from the other parts of the gem.

Add support for Cache-Control request directives
This PR adds support for various cache control directives in requests to control how caching is handled by the HTTP client. Based on RFC-9111 which details strategies for max-age, max-stale, min-fresh, and no-cache.

def show
  if request.cache_control_directives.only_if_cached?
    @article = Article.find_cached(params[:id])
    return head(:gateway_timeout) if @article.nil?
  else
    @article = Article.find(params[:id])
  end
  render :show
end

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

Until next time!

Subscribe to get these updates mailed to you.