本周的 Rails 代码库变更主要聚焦于安全性,包括重写的《Securing Rails》指南、一个阻止 multipart 表单数据中使用任意编码的 Rack 补丁、经过加固的 GitHub Actions 工作流生成模板,以及一项确保关联作用域保留所有者条件的新默认行为。其他值得注意的变更包括:放弃对 Active Record 6.1 marshal 格式的支持、在类属性和令牌列表中支持 Ruby Set 对象、将 Action Mailer 与 Active Job 解耦,以及多项性能改进和错误修复,例如 String#truncate_words 获得了 100 倍的速度提升。本周共有 34 位贡献者参与,并且 Agents on Rails 基准测试新增了四个 AI 模型版本。
Hi, it’s Claudio Baccigalupo. This week’s changes to the Rails codebase have a strong focus on security, from a rewritten guide to safer defaults for new apps.
Rewrite the Securing Rails guide
As part of the Rails Foundation documentation effort, the refreshed guide drops outdated sections and old gems, adds a new section on cookies, and covers file uploads with Active Storage.
Patch Rack::Multipart::Parser to not allow arbitrary encoding
Multipart form data submitted in arbitrary encodings has little to no legitimate use, but it has been used several times in exploit chains targeting Rails applications. Rails now patches Rack to disregard it. The change is also backported to 8.1 and 8.0. If your app depends on that behavior, opt out with:
继续阅读全文
为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。
AI 摘要This week's Rails update introduces a new bin/rails credentials:keys command to list credential keys without exposing secrets, bulk loading of Action Text attachables to eliminate per-attachment queries, and the ability for Action Mailer to boot without Active Job. Other notable changes include NOT ENFORCED check constraint support for PostgreSQL 18+, thread-isolation fixes for ActionController::Live streams, and numerous bug fixes across truncation, Accept header parsing, and SQLite's raised minimum version of 3.37.0. The release closed out with contributions from 48 developers to the Rails codebase.
AI 摘要This is Wojtek's weekly Rails development update, highlighting a new guide for using Hotwire with Rails along with numerous bug fixes across Active Record, Active Job, Active Support, and other Rails components. Key fixes include deprecating unqualified unscope(where:) calls, filtering sensitive parameters from error logs, preventing silent truncation of 64-bit integers, correcting DST gap time shifts, and no longer exposing encryption keys in inspect output. The week saw contributions from 41 developers to the Rails codebase.
AI 摘要Marco Roth, creator of Herb and ReActionView, joins the On Rails podcast to explain how Herb parses HTML and ERB together, allowing broken views to be caught before they reach production, with Herb set to become part of Rails 8.2. The conversation also covers how ReActionView makes Rails views reactive without requiring rewrites, the story behind RubyEvents.org, and why such tooling matters even more when AI agents write templates.
AI 摘要This edition of 'This Week in Rails' announces the release of Rails 8.0.5.2 and 8.1.4.1, security updates addressing 21 security issues. The issue also highlights a busy week of bug fixes across the framework, including corrections to Active Record features like merging relations, default ordering, inheritance of parent-class attributes and associations, and preloading through associations, as well as fixes in caching, URL generation, and message encryption.
AI 摘要Rails versions 8.0.5.2 and 8.1.4.1 have been released as security updates addressing 21 security issues, including arbitrary file read/write and remote code execution in Active Storage, XSS vulnerabilities in Action View, DoS vulnerabilities, session handling issues, and IP spoofing. The Rails team strongly recommends upgrading as soon as possible, noting that older versions are unsupported and security support for the 8.0 series ends on November 7, 2026. SHA-256 hashes for the released gems are also provided so users can verify the integrity of their downloads.