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

推荐订阅源

V
V2EX
P
Proofpoint News Feed
D
DataBreaches.Net
C
Check Point Blog
L
LangChain Blog
量子位
美团技术团队
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
V
Visual Studio Blog
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
腾讯CDC
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale

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
Schema-Enforced JSON Access, Postgres Type Decoding, and ...
David Heinemeier Hansson · 2025-12-05 · via Ruby on Rails: Compress the complexity of modern web apps

Friday, December 5, 2025
Posted by Emmanuel Hayford

Hi, it’s Emmanuel Hayford. Here’s a look at the highlights from this week’s updates to the Rails codebase.

Add schematized json for has_json
Provides a schema-enforced access object for a JSON attribute. This allows you to assign values directly from the UI as strings, and still have them set with the correct JSON type in the database.

Only the three basic JSON types are supported: boolean, integer, and string. No nesting either. These types can either be set by referring to them by their symbol or by setting a default value. Default values are set when a new model is instantiated and on before_save (if defined).

Examples:

class Account < ApplicationRecord
  has_json :settings, restrict_creation_to_admins: true, max_invites: 10, greeting: "Hello!"
  has_delegated_json :flags, beta: false, staff: :boolean
end

a = Account.new
a.settings.restrict_creation_to_admins? # => true
a.settings.max_invites = "100" # => Set to integer 100
a.settings = { "restrict_creation_to_admins" => "false", "max_invites" => "500", "greeting" => "goodbye" }
a.settings.greeting # => "goodbye"
a.staff # => nil
a.staff = true
a.staff? # => true

Add SecureRandom.base32
Rails adds a new helper to SecureRandom in SecureRandom.base32, which generates a random Base32, uppercase, human-friendly, case-insensitive string. Essentially allowing:

SecureRandom.base32        # => "PAK1NG78CM1HJ44A"
SecureRandom.base32(24)    # => "BN9EAB8RG9BNTTC9BX7P5JGJ"

ActionText: Validate RemoteImage URLs
RemoteImage.from_node now validates the URL before creating a RemoteImage object, using the same regex that AssetUrlHelper uses during rendering. URLs like “image.png” that would previously have been passed to the asset pipeline and raised an ActionView::Template::Error are rejected early, and gracefully fail by resulting in a MissingAttachable.

Introduce DevToolsController for Chrome workspaces
Add a new internal route in development to respond to Chromium DevTools GET requests. This allows the app folder to be easily connected as a workspace in Chromium-based browsers.

Restore missing Postgres type decoding
Decode PostgreSQL bytea and money columns when they appear in direct query results.

bytea columns are now decoded into binary-encoded String values, and money columns are decoded into BigDecimal instead of String.

ActiveRecord::Base.connection
     .select_value("select '\\x48656c6c6f'::bytea").encoding
#=> Encoding::BINARY

ActiveRecord::Base.connection
     .select_value("select '12.34'::money").class
#=> BigDecimal

ActiveStorage immediate variants
This Pull Request introduces the immediate option and follows the existing patterns around preprocessed.

has_one_attached :avatar_with_immediate do |attachable|
  attachable.variant :thumb, resize_to_limit: [4, 4], immediate: true
end

Extract ActionText::Editor base class and ActionText::TrixEditor adapter
The introduction of the ActionText::TrixEditor class enables the deprecation of a variety of class and instance-level methods across the ActionText namespace. Action Text benefits from deprecating methods in order to reduce its public API.

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

Until next time!

Subscribe to get these updates mailed to you.