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

推荐订阅源

T
The Blog of Author Tim Ferriss
IT之家
IT之家
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
C
Check Point Blog
T
Tailwind CSS Blog
博客园 - Franky
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
博客园 - 叶小钗
J
Java Code Geeks
腾讯CDC
罗磊的独立博客
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
B
Blog
V
Visual Studio Blog
F
Fortinet All Blogs

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
March 31st 2023 edition 🌸
David Heinemeier Hansson · 2023-03-31 · via Ruby on Rails: Compress the complexity of modern web apps

Hi, it’s zzak, writing in from Aomori, Japan, home of the great Jonan Scheffler.
2023 is officially 25% over, time to enjoy 🌸 and explore this week’s changes in the Rails codebase.

Add debug gem back to the Gemfile template
With the release of Ruby v3.2.2, which happened today, we can safely add the “debug” gem back to the Gemfile template for generated Rails apps.

Infer foreign_key when inverse_of is present
This PR makes has_one and has_many associations automatically infer the foreign_key option when the inverse_of option is present.

Action Cable: assert_broadcasts return the messages that were broadcast
This PR makes Action Cable’s assert_broadcasts return the messages that were broadcast.

This way you can more easily test them, for example:

messages = assert_broadcasts("test", 2) do
  ActionCable.server.broadcast "test", { message: "one" }
  ActionCable.server.broadcast "test", { message: "two" }
end
assert_equal 2, messages.length
assert_equal({ "message" => "one" }, messages.first)
assert_equal({ "message" => "two" }, messages.last)

This is helpful if you expect lots of messages to be broadcast or if you want to only match on some element of the data; assert_broadcast_on doesn’t work well in either of those scenarios.

Active Storage: Safe for Direct Uploads in js Libraries or Frameworks
This PR allows support for additional headers when using direct uploads from the client side, in order to support various types of authentication such as Bearer tokens, API keys, Basic auth, OAuth 1.0, Digest auth, etc.

Add zettabyte to number_to_human_size
Zettabytes (ZB) has been added to Active Support.

ActiveSupport::NumberHelper.number_to_human_size(1.kilobyte**7)
#=> "1 ZB"

Set charset in content type response headers (OWASP)
This PR ensures the charset is included in all Content-Type headers emitted from Rails.

OWASP recommends that every HTTP Response contains a Content-Type header with safe character set.

Active Storage: Remove mini_mime usage in favour of marcel
One less dependency to worry about upgrading!

Fix Rails generated index name being too long
Auto generated index names are now limited to 62 bytes, which fits within the default index name length limits for MySQL, Postgres and SQLite.

Implement marshal_dump and marshal_load on ActiveRecord::Base
A more stable and optimized Marshal serializer for Active Record models has been introduced.

You can opt in via config.active_record.marshalling_format_version = 7.1.

Add ActiveSupport load hook for ActionText::EncryptedRichText
Previously ActionText::Record and ActionText::RichText have dedicated load hooks.
This PR adds an additional hook for ActionText::EncryptedRichText, so that external libraries have a similarly simple way to run code after the subclass is loaded.

Implement provider_job_id for Backburner jobs
This PR implements provider_job_id for the Beanstalk ActiveJob QueueAdapter.
For example, if you want to be able to cancel jobs:

Beaneater::Job.new(
  Backburner::Connection.new(Backburner.configuration.beanstalk_url),
  {id: job.provider_job_id}
).delete

Load Rake tasks only once for command suggestions
After this PR the bin/rails --help command will now list only framework and plugin commands. Rake tasks defined in lib/tasks/*.rake files will no longer be included.
For a list of those tasks, use rake -T.

Include READMEs in main framework pages of the API documentation
This PR teaches RDoc to include the Rails API docs to include each of the relevant libraries READMEs for the top-level constant.
Previously many of these libraries modules had empty descriptions in the API docs, so now they have all of the relevant information which is a nice improvement!

Alias ActionController::Parameters except as without
This PR adds support for without as an alias to except on StrongParameters.

For example, you can now do:

@params[:person].without(:name)

Which is the same as:

@params[:person].except(:name)

Rubocop markdown snippets
This PR adds rubocop-md for linting all markdown files.
Ensuring any code snippets in the guides also follow the Rails coding conventions, without having to manually review every change that comes in.

Add markdownlint to guides
A follow up to the previous PR, now all markdown content in the guides is linted using markdownlint.

Allow destroying active storage variants
When creating active storage variants, ActiveStorage::VariantRecord is inserted, then a file is uploaded.
If the upload fails, the file can be missing even though an ActiveStorage::VariantRecord exists in the database.
In this case, we can now delete the corresponding record of just one variant via this API:

attachable.variant(resize_to_limit: [100, 100]).destroy

Allow Attachables to override default template when attachment is missing
When rendering ActionText attachments, if the underlying attachable has been removed, currently Rails renders the action_text/attachables/missing_attachable partial for all attachable types. Consuming applications can override this partial, but it is global across all attachable models.

Now you can render model-specific partials when necessary, for example, you could render a placeholder image for a file attachment or the text “Deleted User” for a User attachment.

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

Until next time!

Subscribe to get these updates mailed to you.