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

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
博客园 - 司徒正美
J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
D
Docker
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
腾讯CDC
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
M
MIT News - Artificial intelligence
Jina AI
Jina AI
I
InfoQ
雷峰网
雷峰网
The Cloudflare Blog
美团技术团队
Engineering at Meta
Engineering at Meta

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
A much needed Active Storage documentation with a new opt...
David Heinemeier Hansson · 2023-07-23 · via Ruby on Rails: Compress the complexity of modern web apps

Sunday, July 23, 2023
Posted by Emmanuel Hayford

This is Emmanuel… you haven’t heard from me in a while. I’m doing great, and have a few merged pull requests that I want to share with you.

Don’t show secrets for MessageVerifier#inspect and KeyGenerator#inspect If anyone calls a cipher in the console, it will reveal the secret of the encryptor. By overriding the inspect method to display only the class name, we can prevent accidental exposure of sensitive information.

Active Record commit transaction on return, break and throw There’s a lot of history around this PR. In short Rails 7.1 will get a new configuration option that defines whether return , break and throw inside a transaction block cause the transaction to be committed or rolled back. Let’s take this example:

Model.transaction do
  model.save
  return
  other_model.save
end

With the new config.active_record.commit_transaction_on_non_local_return set to false , this transaction will rollback upon hitting return, if set to true , the transaction will be committed.

Document common ActiveStorage issues When attaching files to a has_many_attached association, the default behaviour is to replace any existing attachments. However, if you wish to preserve existing attachments and add new ones, you can achieve this by setting Rails.application.config.replace_on_assign_to_many to false. This PR properly documents this behaviour.

Specify when to generate has_secure_token Rails has a has_secure_token method that employs SecureRandom::base58 to generate a 24-character unique token for a model. With this PR, one can specify at what point during the model’s life-cycle the token is generated via an on: option. This PR ensures we can do something like:

class User < ApplicationRecord
  has_secure_token on: :initialize
end

By passing the on: :initialize , the token is generated in an after_initialize callback as opposed a before_* callback which is the default behaviour.

In the last fourteen days, we’ve had 37 generous contributors.

That’s all I’ve got for today!

Your weekly inside scoop of interesting commits, pull requests and more from Rails.

Subscribe to get these updates mailed to you.