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

推荐订阅源

J
Java Code Geeks
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
Jina AI
Jina AI
博客园_首页
M
MIT News - Artificial intelligence
D
DataBreaches.Net
L
LangChain Blog
宝玉的分享
宝玉的分享
F
Fortinet All Blogs
A
About on SuperTechFans
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
腾讯CDC
Vercel News
Vercel News
雷峰网
雷峰网
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】

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
Improvements to routing, Active Storage configs, time tra...
David Heinemeier Hansson · 2025-09-19 · via Ruby on Rails: Compress the complexity of modern web apps

Friday, September 19, 2025
Posted by Emmanuel Hayford

Hey, Emmanuel Hayford here with the latest from the Rails codebase. Let’s get to it!

Oh! In case you missed it, all the talks from #RailsWorld 2025 are now available online here.

Fix SCRIPT_NAME handling for engines mounted at root.
When an engine is mounted at / and SCRIPT_NAME is in use, URL helpers were incorrectly dropping the script name from generated URLs. The issue was traced to RoutesProxy#merge_script_names, which didn’t handle the edge case where the script name was just /. The fix trims trailing slashes from new_script_name, restoring correct URL generation for apps deployed under a path prefix.

Generalize :rich_text_area Capybara selector
The :rich_text_area Capybara selector no longer depends on a <trix-editor> element and instead looks for role="textbox" and contenteditable attributes. This change makes it easier to support other Action Text–capable WYSIWYG editors. The fill_in_rich_textarea test helper was also updated to use the .value property on <trix-editor> (available since trix v2.1.7) before falling back to editor.loadHTML().

Show engine routes in /rails/info/routes
Engine routes are now displayed in /rails/info/routes alongside application routes. Previously, only the main application routes were shown because _routes.routes excluded engine routes. This change uses Rails.application.routes.routes, ensuring that mounted engines appear in the routes output as well.

Restore Active Storage config to disable variants and analyzers
Active Storage now lets you fully configure which analyzers and variant processor to use. You can clear out analyzers entirely or provide your own:

# ActiveStorage.analyzers can be set to an empty array:
config.active_storage.analyzers = []
# => ActiveStorage.analyzers = []

# or use custom analyzer:
config.active_storage.analyzers = [ CustomAnalyzer ]
# => ActiveStorage.analyzers = [ CustomAnalyzer ]

If no configuration is provided, it will use the default analyzers.

You can also disable variant processor to remove warnings on startup about missing gems.

config.active_storage.variant_processor = :disabled

Fix time attribute dirty tracking with timezone conversions
Time-only attributes could be incorrectly marked as changed when assigning the same time, due to timezone conversions shifting the hidden date part. The fix normalizes time values to a fixed date (2000-01-01) during conversions, preventing false dirty tracking while leaving datetime attributes unchanged.

Before (Bug)

  # Configuration
  Time.zone = "Tokyo"
  ActiveRecord.default_timezone = :utc

  user = User.create!(created_at: "14:30")
  user.reload

  user.created_at = "14:30"
  user.changed_attribute_names_to_save
  # => ["created_at"] # Incorrectly marked as changed!

After (Fixed)

  # Configuration
  config.active_record.use_fixed_date_for_time_attributes = true

  user = User.create!(created_at: "14:30")
  user.reload

  user.created_at = "14:30"
  user.changed_attribute_names_to_save
  # => [] # Correctly not marked as changed

RateLimiting: support method names for :by and :with
Prior to this commit, :by and :with options only supported callables. This commit aims to bring rate limiting closer in parity to callbacks declarations like before_action and after_action by supporting instance method names as well.

Without this change, multi-line customized callables can make declarations difficult to read. Similarly, shared customization would require a local variable to be re-used. For example:

  rate_limiting_bucket = -> { ... }

  rate_limit to: 3, within: 1.minutes, by: rate_limiting_bucket
  rate_limit to: 10, within: 5.minutes, by: rate_limiting_bucket
  rate_limit to: 30, within: 10.minutes,
    by: -> {
      # ...
      # multiple lines
      # ...
    },
    with: -> {
      # ...
      # multiple lines
      # ...
    }

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

Until next time!

Subscribe to get these updates mailed to you.