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

推荐订阅源

罗磊的独立博客
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
A
About on SuperTechFans
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
Recent Announcements
Recent Announcements
D
DataBreaches.Net
B
Blog
博客园 - 【当耐特】
爱范儿
爱范儿
有赞技术团队
有赞技术团队
P
Proofpoint News Feed
WordPress大学
WordPress大学
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
Microsoft Azure Blog
Microsoft Azure Blog
雷峰网
雷峰网
量子位
G
Google Developers 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
This Week in Rails: 7.1 beta release, Bun support and more!
David Heinemeier Hansson · 2023-09-15 · via Ruby on Rails: Compress the complexity of modern web apps

Friday, September 15, 2023
Posted by greg

Hi, it’s Greg, bring you the latest changes in the Rails codebase.

Rails 7.1 beta release
The first beta version of Rails 7.1 has been released! There have been over five thousand commits made by over 800 contributors since Rails 7.0, so this release is packed with new features and improvements. You can read a summary of the changes in the announcement.

Ignore env files (except templates)
To prevent accidentally leaking secrets to code repositories, the default .gitignore file excludes .env(except template ones) files from now on.

Explicit primary_key: option should always take priority in associations
This pull request fixes the issue where the primary_key: option was ignored if the associated model had a query_constraints configured. Now primary_key: option always takes priority, and only if there is no primary_key: option, the query_constraints are used to determine the association_primary_key value.

Instrument Active Record transactions
This pull request adds a new transaction.active_record event to track when Active Record-managed transactions occur. It includes the connection in the payload (useful, for example, in differentiating transactions to different databases),

Add Bun support
Bun is a new and viable alternative to the node.js runtime, yarn package manager, and esbuild bundler. Bun’s primary differentiating characteristic is speed. It’s often multiple times faster than node.js and friends.
Since most vanilla Rails projects are looking to simply sprinkle a little JavaScript here and there (but sometimes want a bit better more of the JavaScript ecosystem than the import-maps provide) Bun is a really good fit and can be easily adopted by new rails projects.

Add dedicated guide for composite primary keys
This pull request adds a dedicated guide for composite primary key usage.
Besides the dedicated guide, #49218 added a suggestion to use composite primary keys on join tables of :through associations.

Support composite foreign keys via migration helpers
The Rails migration helpers now support composite primary keys. A few examples of using them:

# Assuming "carts" table has "(shop_id, id)" as a primary key.
add_foreign_key(:orders, :carts, primary_key: [:shop_id, :id])
# or
add_foreign_key(:orders, :carts, column: [:cart_shop_id, :cart_id])

remove_foreign_key(:orders, :carts, primary_key: [:shop_id, :id])
foreign_key_exists?(:orders, :carts, primary_key: [:shop_id, :id])

Add “Testing View Partials” section to the Testing Guides
A “Testing View Partials” section is added to the guides that expand upon the variety of tooling available to tests that inherit from ActionView::TestCase.

Adds support for if_not_exists when adding a check constraint.
The add_check_constraint method now accepts an if_not_exists option. If set to true an error won’t be raised if the check constraint already exists. In addition, if_exists and if_not_exists options are transposed if set when reversing remove_check_constraint and add_check_constraint. This enables the simple creation of idempotent, non-transactional migrations.

Encryption: support support_unencrypted_data at a per-attribute level
If ActiveRecord::Encryption.config.support_unencrypted_data is enabled, this change allows you to override that global setting on an attribute should you need.

Raise error when generating attribute with a dangerous name
Generating a model with attributes named hash or save should raise an error instead of generating a migration with an invalid attribute, and this pull request made that happen.

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

Until next time!