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

推荐订阅源

Recent Announcements
Recent Announcements
博客园 - Franky
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
爱范儿
爱范儿
罗磊的独立博客
博客园_首页
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
V
Visual Studio Blog
T
Tailwind CSS 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
Rails console improvements, assertionless tests reporting...
David Heinemeier Hansson · 2024-05-03 · via Ruby on Rails: Compress the complexity of modern web apps

Friday, May 3, 2024
Posted by Greg

Hi, it’s Greg. Let’s explore this week’s changes in the Rails codebase.

Build Rails console on top of IRB’s latest official APIs
The Rails console is built on top of IRB, but due to the lack of an extension API, it was extending it with monkey patches. Since IRB received a lot of improvements and an extension API recently, this pull request changes the Rails console to be built on top of that. This will make the Rails helpers show up in the help message among others wins.

Turn app:update into a command to add –force
This pull request changes the app:update task to be a Rails command, and then adds the --force flag to it, to allow running bin/rails app:update while accepting all the changes it makes.

Fix count queries on includes+references for models with composite primary keys
Since SQLite and older MySQL do not support using COUNT DISTINCT with multiple columns, running a count query with composite primary keys caused an error. This pull request changes them to use a subquery.

Allow assertionless tests to be reported
It is very easy to write a “false positive” broken test that actually tests nothing (or can become such in the future). A simple example:

def test_active
  active_users = User.active.to_a
  active_users.each do |user|
    assert user.active?
  end
end

The assertion is only run if the scope returns at least one user. The change in this pull request allows to easily detect when such assertion is not run. With the following configuration, assertionless tests will be marked as failed and not silently pass.

config.active_support.assertionless_tests_behavior = :raise # also available :ignore and :log

Add support for recursive common table expressions in ActiveRecord
While Rails 7.1 has added support for writing Common Table Expressions(CTEs), this support does not extend to recursive CTEs. This pull request adds a QueryMethods#with_recursive construct to enable recursive CTEs.

Add a Date decoder to the PostgreSQL adapter
This pull request adds a Date decoder to the PostgreSQL adapter to type cast dates at the connection level, so when a raw query is run, the columns will be cast to a date instead of a string. Before:

ActiveRecord::Base.connection.select_value("select '2024-01-01'::date").class 
#=> String

After:

ActiveRecord::Base.connection.select_value("select '2024-01-01'::date").class 
#=>  Date 

This change brings the PostgreSQL adapter to parity (for dates) with the Mysql2 adapter.

Remove all deprecated code
All code deprecated in 7.1 is removed from the codebase in this pull request.

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

Until next time!

Subscribe to get these updates mailed to you.