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

推荐订阅源

L
LangChain Blog
博客园 - 司徒正美
美团技术团队
Martin Fowler
Martin Fowler
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
U
Unit 42
Y
Y Combinator Blog
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
GbyAI
GbyAI
H
Help Net Security
量子位
Last Week in AI
Last Week in AI
博客园_首页
腾讯CDC
小众软件
小众软件

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
Reduce memory used by ActiveSupport::Callbacks, non-colum...
David Heinemeier Hansson · 2023-10-27 · via Ruby on Rails: Compress the complexity of modern web apps

Hi! This is Vipul bringing you the latest from this week’s changes in the Rails codebase.

Reduce memory used by ActiveSupport::Callbacks

Previously, callbacks which were shared with subclasses would not share between them the procs generated in before/after filters. This was also lazily generated so would cause memory growth after an application is booted.

This change adds reuse of these in before/after blocks halving the memory growth from boot to post-request-serving.

Support non-column-backed attributes for enum

This re-adds support for using enum with non-column-backed attributes while still guarding against typos in enum attribute names. When using enum with a non-column-backed attribute, the attribute must be previously declared with an explicit type.

For example:

class Post < ActiveRecord::Base 
  attribute :topic, :string 
  enum topic: %i[science tech engineering math]
end

Handle negative numbers in NumberToHumanSizeConverter

This Pull Request adds support for number_to_human_size to handle negative numbers.

# Before
helper.number_to_human_size(-1234567)
# => "-1234567 Bytes"

# After
helper.number_to_human_size(-1234567)
# => "-1.18 MB"

Dump schema only for a specific db for rollback/up/down tasks for multiple dbs

Before this change, rails db:migrate:primary (and rails db:up:primary, rails db:down:primary) dumped schema files for all the databases, even though this is not necessary. This change fixes this before to only perform dump for specific database.

Fix casting PG money with comma as radix point

For example, when casting "3,50" works as expected instead of raising an error.

Add BroadcastLogger#deep_dup

This change adds proper support for dup for BroadcastLogger class, where just calling dup wouldn’t suffice before.

Fix StrongParameters#extract_value to include blank values

This change fixes extract_value to also work and retain blank values.

params = ActionController::Parameters.new(tags: "ruby,rails,,web")
params.extract_value(:tags) # => ["ruby", "rails", "", "web"]

This helps to fix a bug where using url_helpers generated invalid urls if a records second composite primary key is empty.

Ignore invalid PRIMARY KEY values in ActiveRecord::Persistence.delete method

When some invalid primary key values are passed to ActiveRecord::Persistence.delete method, Active Record still performed a DELETE query even if it is not needed. For example,

irb(main):001> User.delete([])
  User Delete All (0.6ms)  DELETE FROM "users" WHERE 1=0
=> 0

This change now skips unnecessarily running the query.

Fix rails-ujs auto start() in bundled environments

This change fixes using rails-ujs in bundled environments(with esbuild, etc), where rails-ujs would not auto start properly as its start method was getting called twice.

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

Until next time!

Subscribe to get these updates mailed to you.