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

推荐订阅源

MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
小众软件
小众软件
F
Fortinet All Blogs
爱范儿
爱范儿
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
C
Check Point Blog
博客园 - 聂微东
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
A
About on SuperTechFans
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
宝玉的分享
宝玉的分享
Jina AI
Jina AI
H
Hackread – Cybersecurity News, Data Breaches, AI and More

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
Active Record regroup, CurrentAttributes name restriction...
David Heinemeier Hansson · 2023-01-20 · via Ruby on Rails: Compress the complexity of modern web apps

Friday, January 20, 2023
Posted by gregmolnar

Hola, this is Greg, bringing you the latest changes from Rails.

Raise exception when if a restricted attribute name is used with CurrentAttributes
Attribute names like set and reset should not be used with ActiveSupport::CurrentAttributes, because they clash with its public API. With this change, an ArgumentError is raised when a restricted attribute name is used.

Add regroup method to Active Record This pull request adds regroup and regroup! methods to Active Record. Here is an example on how to use it:

Post.group(:title).regroup(:author)

Change assert_emails to return the emails that were sent
Before this pull request, assert_emails just returned true or raised if the assertion failed. From now on, if a single email is sent, a single Mail::Message is returned. If multiple emails were sent, an array is returned.

Rename ::normalize to ::normalize_value_for
The ::normalize method accepts an attribute name and a value, and type casts the value, applying any declared normalizations for the attribute. Because of the way type casting works for most types, the type of the given value can be very different than the attribute type. This allows for potential confusion between the ::normalize method and the ::normalizes method, so to prevent such confusion, this change renames ::normalize to ::normalize_value_for.

We had 28 contributors this past week! 

Until next time!

Subscribe to get these updates mailed to you.