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

推荐订阅源

L
LangChain Blog
J
Java Code Geeks
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
雷峰网
雷峰网
D
DataBreaches.Net
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
V
Visual Studio Blog
Apple Machine Learning Research
Apple Machine Learning Research
N
Netflix TechBlog - Medium
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
Blog — PlanetScale
Blog — PlanetScale
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
Rails World CFP, picture_tag helper and more!
David Heinemeier Hansson · 2023-05-12 · via Ruby on Rails: Compress the complexity of modern web apps

Hi, this is Greg, bringing you this week’s changes in the Rails codebase.

Rails World Call for Papers now open
This CFP is open until June 16, with space in the agenda for 26 talks on two tracks, and up to six workshops. Read the full announcement for more details and submit your proposal!

Prevent duplicate filters for encrypted attributes
When an Active Record encrypted attribute is declared, a filter for it is automatically added to config.filter_parameters. Prior to this pull request, the filter would be re-added every time the model was reloaded. This change ensures filters are only added once so that config.filter_parameters does not grow unbounded.

Prevent non-anonymous modules from becoming frozen
In #48106, Module#deep_dup was changed to return the module itself (not a copy) when the module is not anonymous. However, that causes non-anonymous modules to become frozen via value.deep_dup.freeze when passed to ActiveModel::Type::Helpers::Mutable#immutable_value. So, for example, class attributes can no longer be set on the module.
To prevent such issues, this pull request removes the freeze from immutable_value. immutable_value is only called by ActiveRecord::PredicateBuilder#build_bind_attribute, which only cares that other code cannot mutate the value, not that the value is actually frozen.

Allow PredicateBuilder to recognize schema namespaced table names
Before this change, ActiveRecord::PredicateBuilder assumed that a column name will only be specified in dot notation with a single period. If a column is specified in dot notation for a table that is namespaced in a schema, it used the schema name as the table name. This pull request allows columns to specified in the format schema.table.column as well as table.column.

Support :message_pack as cookies serializer
This commit adds support for :message_pack and :message_pack_allow_marshal as serializers for config.action_dispatch.cookies_serializer, just like config.active_support.message_serializer.

Support :message_pack as message serializer
This change adds support for :message_pack as a serializer for MessageEncryptor and MessageVerifier, and, consequently, as an option for config.active_support.message_serializer.

Default message serializer to :json_allow_marshal
This pull request changes the default message serializer set by config.load_defaults 7.1 from :json to :json_allow_marshal so that upgraded apps can continue to read old messages without additional configuration.
The intention is to eventually change the default to :json (with no Marshal fallback) in Rails 7.2, after some time has passed with apps generating JSON-serialized messages.
Apps can opt in to JSON-only serialization before Rails 7.2 by manually setting config.active_support.message_serializer = :json.

Handle empty list of cache keys
With this change, read_multi, write_multi and fetch multi will bail out early if somehow called with an empty list.
The same change was done for delete_multi in a follow-up pull request.

Make increment_counter/decrement_counter accept an amount argument
This pull request introduces the by option to increment_counter and decrement_counter to make it easier to change counters by an arbitrary value. Example usage:

Company.increment_counter(:users_count, 5, by: 3)

Make Active Record’s query cache an LRU
Active Record query cache is now evicts least recently used entries, with 100 entries as a default. The cache size can be configured via database.yml

development:
  adapter: mysql2
  query_cache: 100

It can also be entirely disabled:

development:
  adapter: mysql2
  query_cache: false

Add a picture_tag helper
This pull request adds support for the HTML picture tag. It supports passing a String, an Array or a Block and passing properties directly to the img tag via the :image key.
Since the picture tag requires an img tag, the last element you provide will be used for the img tag.
For complete control over the picture tag, a block can be passed, which will populate the contents of the tag accordingly. See the pull request for usage examples.

Add matcher support to assert_enqueued_email_with
Currently assert_enqueued_with allows you to pass procs for matching args. However, assert_enqueued_email_with doesn’t let you do that for args and params.
This pull request made assert_enqueued_email_with accept procs for args and params:

assert_enqueued_email_with DeliveryJob, params: -> p { p[:token] =~ /\w+/ } do
  UserMailer.with(token: user.generate_token).email_verification.deliver_later
end

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

Until next time!

Subscribe to get these updates mailed to you.