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

推荐订阅源

小众软件
小众软件
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
J
Java Code Geeks
A
About on SuperTechFans
F
Fortinet All Blogs
B
Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
博客园_首页
博客园 - 叶小钗
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
云风的 BLOG
云风的 BLOG

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
More async queries, pattern matching and no more autoclos...
David Heinemeier Hansson · 2022-05-14 · via Ruby on Rails: Compress the complexity of modern web apps

Saturday, May 14, 2022
Posted by p8

Hi, this is Petrik, bringing you the latest news from the Rails world.

Async aggregate and find_by queries
Active Record async support was limited to loading collections, but among the not so fast queries that would benefit from asynchronicity you often find aggregates as well as hand crafted find_by_sql queries.
We now support the following methods:

  • async_count
  • async_sum
  • async_minimum
  • async_maximum
  • async_average
  • async_pluck
  • async_pick
  • async_find_by_sql
  • async_count_by_sql

Allow CSRF tokens to be stored outside of session

When sessions are not stored in cookies, millions of sessions may be created and constantly evicted just for the CSRF token. This new configuration parameter will make it possible to store the CSRF token somewhere other than the session (i.e. in an encrypted cookie).

Introduce html: and screenshot: kwargs for system test screenshot helper

Being able to request html or screenshot from test code is nicer as it means you can do this selectively per-screenshot, rather than screenshotting/HTML dumping everything when running a test.

Support encrypted attributes on columns with default values

Reading these columns failed because their contents were not encrypted. Now, it will encrypt those values at record-creation time.

Stop autoclosing of PRs
While the idea of cleaning up the PRs list by nudging reviewers with the stale message and closing PRs that didn’t got a review in time could work for the maintainers, in practice it discourages contributors to submit contributions.

Provide pattern matching for ActiveModel

This provides the Ruby 2.7+ pattern matching interface for hash patterns, which allows the user to pattern match against anything that includes the ActiveModel::AttributeMethods module (e.g., ActiveRecord::Base).

Avoid query from calculations on contradictory relations

Previously calculations would make a query even when passed a contradiction, such as User.where(id: []).count. We no longer perform a query in that scenario.

Add –name option to the app generator

The option –name will override the application name to be different from the folder name.

Add active_record.destroy_association_async_batch_size configuration

This allows applications to specify the maximum number of records that will be destroyed in a single background job by the dependent: :destroy_async association option. If the number of dependent records is greater than this configuration, the records will be destroyed in multiple background jobs.

Since last time, 102 people contributed to Rails. As usual, there are too many changes to cover them all, but you can check out all of these here. Until next time!