Safer secrets, ZJIT, and more!

Emmanuel Hayford · 2026年10月23日

AI 摘要 AI 生成,可能有误

本周的 Rails 更新带来了多项安全性和可靠性改进,包括在 8.2 中将消息序列化器默认设置为 :json 且不回退到 Marshal、以仅限所有者的权限创建本地密钥文件,以及防止路由重定向中的主机注入。此外,它还为新推出的 ZJIT 编译器添加了 config.zjit 配置项,使用 SQLite 原生的 RENAME COLUMN 而非重建表,将 MySQL 最低版本要求提升至 5.7.9,并包含针对 in_order_of、numericality 数值验证、元组 where 子句以及 deliver_all_later 的众多修复。其他清理工作涵盖新增的 before_ractorize 加载钩子、基于 BasicObject 的弃用代理,以及对 ssl_default_redirect_status 和 raise_on_assign_to_attr_readonly 的弃用。

New apps stop falling back to Marshal for signed messages, the local secret file is no longer world-readable, and SQLite finally renames columns the way the database intended. Here’s what’s new in Rails:

Default config.active_support.message_serializer to :json for 8.2
With config.load_defaults 8.2, messages from MessageVerifier and MessageEncryptor no longer fall back to deserializing Marshal payloads. That covers signed IDs, signed GlobalIDs, Active Storage keys, and the rest. Apps on 7.1 through 8.1 keep :json_allow_marshal. Confirm nothing still arrives as Marshal via the message_serializer_fallback.active_support notification before you switch.

Create tmp/local_secret.txt with owner-only permissions
The development and test secret_key_base file was created with the process umask, often 022, so it was world-readable. It is now written as 0600, and an existing file is tightened on read on non-Windows platforms, matching config/master.key.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Ruby on Rails Blog

credentials:keys, bulk Action Text, and more!

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.

Securing Rails

AI 摘要This week's Rails codebase changes focus heavily on security, featuring a rewritten 'Securing Rails' guide, a Rack patch blocking arbitrary encodings in multipart form data, hardened generated GitHub Actions workflows, and a new default ensuring association scopes keep owner conditions. Other notable changes include dropping support for the Active Record 6.1 marshal format, supporting Ruby Set objects in class attributes and token lists, decoupling Action Mailer from Active Job, and various performance improvements and bug fixes such as a 100x speedup for String#truncate_words. The week saw 34 contributors, and four new AI model versions were added to the Agents on Rails benchmark.

Hotwire guide and more

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.

On Rails — Marco Roth: Teaching Rails to Read Its Own Template

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.

This Week in Rails: November 6, 2026

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.